Re: Separate the attribute physical order from logical order - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: Separate the attribute physical order from logical order
Date
Msg-id 20220628133856.GA28130@telsasoft.com
Whole thread Raw
In response to Separate the attribute physical order from logical order  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: Separate the attribute physical order from logical order  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-hackers
On Tue, Jun 28, 2022 at 04:32:30PM +0800, Julien Rouhaud wrote:
> psql displays a table columns information using the logical order rather the
> physical order, and if verbose emits an addition "Physical order" footer if the
> logical layout is different from the physical one.

FYI: the footer would work really poorly for us, since we use hundreds of
columns and sometimes over 1000 (historically up to 1600).  I think it'd be
better to show the physical position as an additional column, or a \d option to
sort by physical attnum.  (I'm not sure if it'd be useful for our case to see
the extra columns, but at least it won't create a "footer" which is multiple
pages long.  Actually, I've sometimes wished for a "\d-" quiet mode which would
show everything *except* the list of column names, or perhaps only show those
columns which are referenced by the list of indexes/constraints/stats
objects/etc).

BTW, since 2 years ago, when rewriting partitions to promote a column type, we
recreate the parent table sorted by attlen, to minimize alignment overhead in
new children.  AFAICT your patch is about adding an logical column order, not
about updating tables with a new physical order.

-- 
Justin



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Separate the attribute physical order from logical order
Next
From: Julien Rouhaud
Date:
Subject: Re: Separate the attribute physical order from logical order