Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1poaee-0002JJ-4D for pgsql-performance@arkaria.postgresql.org; Tue, 18 Apr 2023 02:01:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1poaec-0006AY-PD for pgsql-performance@arkaria.postgresql.org; Tue, 18 Apr 2023 02:01:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1poaec-0006AE-F1 for pgsql-performance@lists.postgresql.org; Tue, 18 Apr 2023 02:01:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1poaea-003XOp-3J for pgsql-performance@postgresql.org; Tue, 18 Apr 2023 02:01:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33I215WC2548534; Mon, 17 Apr 2023 22:01:05 -0400 From: Tom Lane To: peter plachta cc: pgsql-performance@postgresql.org Subject: Re: High QPS, random index writes and vacuum In-reply-to: References: Comments: In-reply-to peter plachta message dated "Mon, 17 Apr 2023 17:35:33 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2548532.1681783265.1@sss.pgh.pa.us> Date: Mon, 17 Apr 2023 22:01:05 -0400 Message-ID: <2548533.1681783265@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk peter plachta writes: > The company I work for has a large (50+ instances, 2-4 TB each) Postgres > install. One of the key problems we are facing in vanilla Postgres is > vacuum behavior on high QPS (20K writes/s), random index access on UUIDs. Indexing on a UUID column is an antipattern, because you're pretty much guaranteed the worst-case random access patterns for both lookups and insert/delete/maintenance cases. Can you switch to timestamps or the like? There are proposals out there for more database-friendly ways of generating UUIDs than the traditional ones, but nobody's gotten around to implementing that in Postgres AFAIK. regards, tom lane