Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTqw0-00014k-09 for pgsql-bugs@arkaria.postgresql.org; Wed, 18 Jan 2017 14:09:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cTqvz-0005RA-Hd for pgsql-bugs@arkaria.postgresql.org; Wed, 18 Jan 2017 14:09:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cTqvz-0005R3-2c for pgsql-bugs@postgresql.org; Wed, 18 Jan 2017 14:09:55 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTqvq-0008RV-U9 for pgsql-bugs@postgresql.org; Wed, 18 Jan 2017 14:09:54 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 21F865F794; Wed, 18 Jan 2017 09:08:46 -0500 (EST) Date: Wed, 18 Jan 2017 09:08:46 -0500 From: Stephen Frost To: Joel Sanger Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14263: Query planner is slow to plan UPDATE on a table with many partitions Message-ID: <20170118140845.GY18360@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cOzgB1eY32u41h/k" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 08:42:52 up 193 days, 15:07, 2 users, load average: 0.17, 0.20, 0.16 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --cOzgB1eY32u41h/k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > Unfortunately the partitioning scheme we have is ideal for our regular > workflow, so using less partitions isn't practical. >=20 > 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 --cOzgB1eY32u41h/k Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYf3btAAoJEO1sijiDR2RVdvcP/Rg1WNo2DD3ts3THfM86bp7U MJkVeRiNK43GVNWDnkn7g/4re9KeartsqluZG8czPsS1tslL80/afIkITmP0oGox oCmkZQWGE7h1kmhQBnOfYRN2p2PR6OvdtLZlMZzjhwW+5FCNFyxbUnZyCU88M18y HWXgWYqBrAnxK7EKNb/HpQTDAlh2SCiOCh0ey18r6QlRAObnLId1Jm5ePu3cT5hT TYzujhAWqBU4oVtodmiSYPn1DHAgLMYXKBdFoD8b1h2qgs0t43ExqPVUc3ZOGScK 8X0YCg2mcS8dVk2koQX57WAib7fA4Yo7qIy6QLdX8HkjQtwO7YVz/kiLWBzF8AFi JFbA6eJZop1T4AQ4HgiievCy7tOx2ccAJeTfQIp+/G7FLcbNrkLuvhpVMvve53CO zvp7K1MtwqlzbUF2EzuWQf+j3c7EpnNhpro8TbiONg+H0FVl/9WDyj0XAtUrKYU5 s1fs75Ixs1CqQRi7P1+9xInCvPwxinlrGNLe5mnzn4+fzLH60y7A5lvXDne6qj95 +mjYVw94N99GxZF82Nb7Eh8OK+k8wcb1IN9BSN1R6uH8uBwRAJxCRKowlMYTYgec hKzRC3TPHCFspxYpy3CUVeNSnudx92IGp5QSdq1qOjjvVnFIaL+084UEYg9iaj6+ e+e+H6ZdLfL3iBdO/Xjw =Kb8J -----END PGP SIGNATURE----- --cOzgB1eY32u41h/k--