Re: STATISTICS retained in CREATE TABLE ... LIKE (INCLUDING ALL)?
Tels <nospam-pg-abuse@bloodgate.com>
From: "Tels" <nospam-pg-abuse@bloodgate.com>
To: "David Rowley" <david.rowley@2ndquadrant.com>
Cc: "Tom Lane" <tgl@sss.pgh.pa.us>,
"Stephen Froehlich" <s.froehlich@cablelabs.com>,
"PostgreSQL-development" <pgsql-hackers@postgresql.org>,
"Tomas Vondra" <tomas.vondra@2ndquadrant.com>,
"Alvaro Herrera" <alvherre@2ndquadrant.com>
Date: 2018-01-26T11:03:08Z
Lists: pgsql-hackers, pgsql-novice
Moin, On Fri, January 26, 2018 2:30 am, David Rowley wrote: > On 21 January 2018 at 19:21, David Rowley <david.rowley@2ndquadrant.com> > wrote: >> On 20 January 2018 at 18:50, Tom Lane <tgl@sss.pgh.pa.us> wrote: >>> Stephen Froehlich <s.froehlich@cablelabs.com> writes: >>>> Are custom statistics in PG10 retained in LIKE (INCLUDING ALL) or do I >>>> need to recreate the statistics by hand each time I create a new >>>> table? >>> >>> LIKE doesn't know about those, no. Perhaps it should. >> >> Agreed. ALL does not mean MOST. > > (Moving to -hackers) > > The attached implements this. > > Looking at "LIKE ALL" in more detail in the docs it claims to be > equivalent to "INCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING > CONSTRAINTS INCLUDING INDEXES INCLUDING STORAGE INCLUDING COMMENTS", > so it didn't seem right to magically have LIKE ALL include something > that there's no option to include individually, so I added INCLUDING > STATISTICS. Note sure if someone want's to exclude statistics, but it is good that one can. So +1 from me. Looking at the patch, at first I thought the order was sorted and you swapped STORAGE and STATISTICS by accident. But then, it seems the order is semi-random. Should that list be sorted or is it already sorted by some criteria that I don't see? - <literal>INCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING CONSTRAINTS INCLUDING INDEXES INCLUDING STORAGE INCLUDING COMMENTS</literal>. + <literal>INCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING CONSTRAINTS INCLUDING INDEXES INCLUDING STORAGE INCLUDING STATISTICS INCLUDING COMMENTS</literal>. Best wishes, Tels
Commits
-
Clone extended stats in CREATE TABLE (LIKE INCLUDING ALL)
- 911e6236bab5 10.4 landed
- 5564c1181548 11.0 landed
-
Identity columns
- 321732705363 10.0 cited