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

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tels <nospam-pg-abuse(at)bloodgate(dot)com>, Stephen Froehlich <s(dot)froehlich(at)cablelabs(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: STATISTICS retained in CREATE TABLE ... LIKE (INCLUDING ALL)?
Date: 2018-01-29 09:55:34
Message-ID: CAKJS1f-J4NJcUa31Xom-hwigUe=pKeSqnzz3kzz4+V6jpV5kgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-novice

On 28 January 2018 at 12:00, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
> On 01/27/2018 10:45 PM, Tom Lane wrote:
>> David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> writes:
>>> I'd offer to put it back to the order of the enum, but I want to
>>> minimise the invasiveness of the patch. I'm not sure yet if it should
>>> be classed as a bug fix or a new feature.
>>
>> FWIW, I'd call it a new feature.
>>
>
> I'm not sure what exactly the feature would be? I mean "keep statistics
> even if you only ask for indexes" does not seem particularly helpful to
> me. So I see it more like a bug - I certainly think it should have been
> handled differently in 10.

FWIW I'm leaning more towards this being a bug fix too. The only thing
that put doubt in my mind was after digging into the code I realised
that "ALL" means all of TableLikeOption's bits rather than all things
copyable about the table. However, you'd only have to think slightly
beyond that to then think the bug is that the TableLikeOption enum is
just missing an option for including statistics in the first place.

If I'd realised this was missing during my review I'd have pushed back
and said to Tomas that this needs to be added before commit.

Now I'll ask; On me doing so, would anyone have pushed back on that
request and said that what I'm asking is a separate feature?

If the answer to that is "no", then this is a bug that should be fixed
and backpacked to v10.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-01-29 10:12:43 Re: STATISTICS retained in CREATE TABLE ... LIKE (INCLUDING ALL)?
Previous Message Andres Freund 2018-01-29 09:53:50 Re: JIT compiling with LLVM v9.1

Browse pgsql-novice by date

  From Date Subject
Next Message David Rowley 2018-01-29 10:12:43 Re: STATISTICS retained in CREATE TABLE ... LIKE (INCLUDING ALL)?
Previous Message Dav Clark 2018-01-28 18:39:24 Using the pgadmin4 packages