Re: ALTER TABLE ADD COLUMN fast default
David Rowley <david.rowley@2ndquadrant.com>
From: David Rowley <david.rowley@2ndquadrant.com>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>,
Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-02-20T23:32:55Z
Lists: pgsql-hackers
On 21 February 2018 at 00:38, David Rowley <david.rowley@2ndquadrant.com> wrote: > Using: select sum(c10) from t; > ... > v11 + create.sql: tps = 3330.131437 > v11 + create-alter.sql: tps = 1398.635251 It seems the difference between these two cases is down to slot_getsomeattrs being asked to deform up to attnum 1000 for the create-alter.sql case, and only up to attnum 10 for the create.sql case. Both plans are using physical tlists per EXPLAIN VERBOSE. I've not managed to narrow down the reason for the difference yet. Looks like it might take a bit of time with a debugger to find the point where the code paths of the two cases diverge. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Clean up treatment of missing default and CHECK-constraint records.
- 091e22b2e673 14.0 landed
-
Fast ALTER TABLE ADD COLUMN with a non-NULL default
- 16828d5c0273 11.0 landed
-
Fix application of identity values in some cases
- 533c5d8bddf0 11.0 cited