On 21 February 2018 at 00:38, David Rowley <david.row...@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