From: Victor Sudakov <vas@sibptus.ru>
To: pgsql-admin@lists.postgresql.org
Cc: Ron <ronljohnsonjr@gmail.com>
Subject: Re: Large number of partitions of a table
Date: Wed, 19 Jan 2022 10:27:33 +0000
Message-ID: <YefnlQRGBnWj4YbF@admin.sibptus.ru> (raw)
In-Reply-To: <d45899c8-187d-4a1d-563b-f5842243e770@gmail.com>
References: <YeTYA63gEXNePfkv@admin.sibptus.ru>
<3919502.1642393668@sss.pgh.pa.us>
<YeUAx56Juri43xGY@admin.sibptus.ru>
<671340a5-1960-e5dc-1d09-4b7f36cda2c8@gmail.com>
<YeYr88f3jXHlijU9@admin.sibptus.ru>
<254601.1642480213@sss.pgh.pa.us>
<YeZV0QSOly8Pnx5d@admin.sibptus.ru>
<268771.1642489687@sss.pgh.pa.us>
<YeZ3/4TSd+xHAlDl@admin.sibptus.ru>
<d45899c8-187d-4a1d-563b-f5842243e770@gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: vas@sibptus.ru, pgsql-admin@lists.postgresql.org, ronljohnsonjr@gmail.com
Subject: Re: Large number of partitions of a table
In-Reply-To: <YefnlQRGBnWj4YbF@admin.sibptus.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox