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 1nA8Bq-0006uV-58 for pgsql-admin@arkaria.postgresql.org; Wed, 19 Jan 2022 10:27:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nA8Bo-0000Nq-US for pgsql-admin@arkaria.postgresql.org; Wed, 19 Jan 2022 10:27:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nA8Bo-0000NR-4K for pgsql-admin@lists.postgresql.org; Wed, 19 Jan 2022 10:27:40 +0000 Received: from admin.sibptus.ru ([2001:19f0:5001:21dc::10]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nA8Bk-0003iK-PQ for pgsql-admin@lists.postgresql.org; Wed, 19 Jan 2022 10:27:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=In-Reply-To:Message-ID:Subject:To:From:Date; bh=XDA403cu3SabvCGfU8u349vpc8fS2pn0cz982YhKn1A=; b=OiX9P7kBvR7GaePLXqjlJSdSDZ bvQ+DegzJRPDDDv60ZJ4Pbi1jEIK9RmFYnZPizRh2czxFXaQQS6WynFnGEqXsAjTSymTvBJF281Pa 5PKRiCelP7ND8OqZffFhgorDhV7Exd534D0f6MB16P/qxWykC5t+3Tl8paw3hVwE1oXI=; Received: from vas by admin.sibptus.ru with local (Exim 4.95 (FreeBSD)) (envelope-from ) id 1nA8Bh-000KRp-N8; Wed, 19 Jan 2022 10:27:33 +0000 Date: Wed, 19 Jan 2022 10:27:33 +0000 From: Victor Sudakov To: pgsql-admin@lists.postgresql.org Cc: Ron Subject: Re: Large number of partitions of a table Message-ID: References: <3919502.1642393668@sss.pgh.pa.us> <671340a5-1960-e5dc-1d09-4b7f36cda2c8@gmail.com> <254601.1642480213@sss.pgh.pa.us> <268771.1642489687@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-PGP-Key: http://admin.sibptus.ru/~vas/ X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron wrote: [dd] > > > > What about the system catalogs however? Will the extra 10000 > > tables and 500000 indexes negatively impact the performance of the > > system catalogs? Are there any caveats you could think of? > > EXPLAIN plans are going to be hilariously gigantic, which means that query > planning would take a loooong time,  No, I'm not observing this for my test queries. With enable_partition_pruning=on (which is the default) all the queries I've tested look neat and short. > And the query planner (in v12, at > least) can generate some pretty bad plans in partitioned tables; I bet there > are edge cases in the QP code that don't work well with 10000 partitions and > 50000 indices. Actually "5.11.6. Best Practices for Declarative Partitioning" says "The query planner is generally able to handle partition hierarchies with up to a few thousand partitions fairly well, provided that typical queries allow the query planner to prune all but a small number of partitions." I admit 10000 partitions is slightly more than "a few thousand". "A few" sounds to me like 3-5. -- Victor Sudakov VAS4-RIPE http://vas.tomsk.ru/ 2:5005/49@fidonet