From: Stephen Frost <sfrost@snowman.net>
To: Joel Sanger <joelsanger@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14263: Query planner is slow to plan UPDATE on a table with many partitions
Date: Wed, 18 Jan 2017 09:08:46 -0500
Message-ID: <20170118140845.GY18360@tamriel.snowman.net> (raw)
In-Reply-To: <CABaOQpwxr=5zEfq7HOJdRdThLp3wrz59rz7n4w3DwtSy76zN3w@mail.gmail.com>
References: <CABaOQpwxr=5zEfq7HOJdRdThLp3wrz59rz7n4w3DwtSy76zN3w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Greetings Joel,
* Joel Sanger (joelsanger@gmail.com) wrote:
> Just to keep this bug current, I am also experiencing the same issue. I'm
> using PostgreSQL 9.6.1 on Debian 8.6.
>
> As an example, i have a table with a *very* large number of partitions. A
> simple select clause has a planning time of 600ms where as the same clause
> as an update results in a 8300ms planning time.
>
> Unfortunately the partitioning scheme we have is ideal for our regular
> workflow, so using less partitions isn't practical.
>
> If there's any update, plans to fix (or not) that would be appreciated.
The short answer is "it's being actively worked on." The slightly
longer answer is that the next version of PG (PG10) is going to have
declarative partitioning, such that you can actually say something like
"ALTER TABLE ... ATTACH PARTITION FOR VALUES FROM x TO y".
That is just the start and we don't (yet) have code committed to improve
planning time when using declarative partitioning, but it's being worked
on and it might make it in time for PG10, or it might not.
If you're really curious and interested in all of this, the right place
to discuss it is on the pgsql-hackers list. If you don't want to follow
all of that traffic then I would suggest you watch
https://planet.postgresql.org as there will surely be blog posts about
all of this as patches are committed to improve things in this area.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: sfrost@snowman.net, joelsanger@gmail.com
Subject: Re: BUG #14263: Query planner is slow to plan UPDATE on a table with many partitions
In-Reply-To: <20170118140845.GY18360@tamriel.snowman.net>
References: <CABaOQpwxr=5zEfq7HOJdRdThLp3wrz59rz7n4w3DwtSy76zN3w@mail.gmail.com> <20170118140845.GY18360@tamriel.snowman.net>
* 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