Re: explain plan difference

2019-11-04 Thread Ravi Krishna
> > Never, unless you drop and recreate the table. Removing a dropped > column would change the attnums of following columns, which we > can't support because the tableoid+attnum is the only persistent > identifier of a column. > > (From memory, operations like VACUUM FULL and CLUSTER will rewri

Re: explain plan difference

2019-11-04 Thread Tom Lane
Ravi Krishna writes: >> VACUUM would not change the state of the dropped columns. > When does it change? Never, unless you drop and recreate the table. Removing a dropped column would change the attnums of following columns, which we can't support because the tableoid+attnum is the only persist

Re: explain plan difference

2019-11-04 Thread Ravi Krishna
>> Just to confirm, we are talking about tables from where some cols were >> deleted in the past, but >> VACUUM FULL not run on that table, right ? > > VACUUM would not change the state of the dropped columns. > When does it change?

Re: explain plan difference

2019-11-04 Thread Tom Lane
Ravi Krishna writes: >> On Nov 3, 2019, at 11:03 PM, Steve Baldwin wrote: >> Thanks very much for the explanation Tom !! You are correct - there are >> dropped columns in the original. > Just to confirm, we are talking about tables from where some cols were > deleted in the past, but > VACUU

Re: explain plan difference

2019-11-04 Thread Ravi Krishna
> On Nov 3, 2019, at 11:03 PM, Steve Baldwin wrote: > > Thanks very much for the explanation Tom !! You are correct - there are > dropped columns in the original. Just to confirm, we are talking about tables from where some cols were deleted in the past, but VACUUM FULL not run on that ta

Re: explain plan difference

2019-11-03 Thread Steve Baldwin
Thanks very much for the explanation Tom !! You are correct - there are dropped columns in the original. Cheers, Steve On Mon, Nov 4, 2019 at 3:01 PM Tom Lane wrote: > Steve Baldwin writes: > > I guess the difference doesn't have a huge bearing (as far as I can tell) > > on the result, but i

Re: explain plan difference

2019-11-03 Thread Tom Lane
Steve Baldwin writes: > I guess the difference doesn't have a huge bearing (as far as I can tell) > on the result, but it just seems odd that the inner-most 'Output' step > outputs the entire row in the case of the copy and only the required field > in the case of the original table. What triggers

explain plan difference

2019-11-03 Thread Steve Baldwin
Can someone please help me understand this: b2bc_dev=# *vacuum full analyze invoice;* VACUUM Time: 39.671 ms b2bc_dev=# *create table invoice_copy as select * from invoice;* SELECT 23 Time: 11.557 ms b2bc_dev=# *alter table invoice_copy add primary key (id);* ALTER TABLE Time: 9.257 ms b2bc_dev=#