Re: STATISTICS retained in CREATE TABLE ... LIKE (INCLUDING ALL)?

Поиск
Список
Период
Сортировка
От Tels
Тема Re: STATISTICS retained in CREATE TABLE ... LIKE (INCLUDING ALL)?
Дата
Msg-id f31257654fd0e5954b6bc315ec8187bf.squirrel@sm.webmail.pair.com
обсуждение исходный текст
Ответ на Re: STATISTICS retained in CREATE TABLE ... LIKE (INCLUDING ALL)?  (David Rowley <david.rowley@2ndquadrant.com>)
Ответы Re: STATISTICS retained in CREATE TABLE ... LIKE (INCLUDING ALL)?
Список pgsql-hackers
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Emre Hasegeli
Дата:
Сообщение: Re: Redefining inet_net_ntop
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] MERGE SQL Statement for PG11