[HACKERS] pg_statistic_ext.staenabled might not be the best column name

Поиск
Список
Период
Сортировка
Искать

[HACKERS] pg_statistic_ext.staenabled might not be the best column name

От:
David Rowley <david.rowley@2ndquadrant.com>
Дата:
Вложения:
I'd been thinking that staenabled is not the most suitable column name
for storing the types of statistics that are defined for the extended
statistics.  For me, this indicates that something can be disabled,
but there's no syntax for that, and even if there was, if we were to
enable/disable the kinds, we'd likely want to keep tabs on which kinds
were originally defined, otherwise it's more of an ADD and DROP than
an ENABLE/DISABLE.

"stakind" seems like a better name. I'd have personally gone with
"statype" but pg_statistic already thinks stakind is better.

A patch which changes this is attached

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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] pg_statistic_ext.staenabled might not be the bestcolumn name

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Wed, Apr 12, 2017 at 9:36 AM, David Rowley
 wrote:
> I'd been thinking that staenabled is not the most suitable column name
> for storing the types of statistics that are defined for the extended
> statistics.

+1.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [HACKERS] pg_statistic_ext.staenabled might not be the best column name

От:
Tomas Vondra <tomas.vondra@2ndquadrant.com>
Дата:


On 04/12/2017 03:36 PM, David Rowley wrote:
> 
> "stakind" seems like a better name. I'd have personally gone with
> "statype" but pg_statistic already thinks stakind is better.

+1 to stakind

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: [HACKERS] pg_statistic_ext.staenabled might not be the best column name

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Tomas Vondra  writes:
> On 04/12/2017 03:36 PM, David Rowley wrote:
>> "stakind" seems like a better name. I'd have personally gone with
>> "statype" but pg_statistic already thinks stakind is better.

> +1 to stakind

I agree with that, but as long as we're rethinking column names here,
was it a good idea to use the same "sta" prefix in pg_statistic_ext
as in pg_statistic?  I do not think there's anyplace else where we're
using the same table-identifying prefix in two different catalogs,
and it seems a little pointless to follow that convention at all if
we're not going to make it a unique prefix.

We could go with "ste" perhaps, or break the convention of 3-character
prefixes and go with "stae".
		regards, tom lane


Re: [HACKERS] pg_statistic_ext.staenabled might not be the bestcolumn name

От:
Heikki Linnakangas <hlinnaka@iki.fi>
Дата:
On 04/13/2017 03:28 PM, Tom Lane wrote:
> Tomas Vondra  writes:
>> On 04/12/2017 03:36 PM, David Rowley wrote:
>>> "stakind" seems like a better name. I'd have personally gone with
>>> "statype" but pg_statistic already thinks stakind is better.
>
>> +1 to stakind
>
> I agree with that, but as long as we're rethinking column names here,
> was it a good idea to use the same "sta" prefix in pg_statistic_ext
> as in pg_statistic?  I do not think there's anyplace else where we're
> using the same table-identifying prefix in two different catalogs,
> and it seems a little pointless to follow that convention at all if
> we're not going to make it a unique prefix.
>
> We could go with "ste" perhaps, or break the convention of 3-character
> prefixes and go with "stae".

We have a bunch of > 3-character prefixes already: amop*, amproc*, 
enum*, cast*. But I think I nevertheless like "ste" better.

That said, we also have two existing tables with the same prefix: 
pg_constraint and pg_conversion. Both use "con" as the prefix. Yes, it 
is a bit confusing, let's not to make the same mistake again.

- Heikki



Re: [HACKERS] pg_statistic_ext.staenabled might not be the bestcolumn name

От:
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Дата:
On 4/13/17 08:37, Heikki Linnakangas wrote:
>> We could go with "ste" perhaps, or break the convention of 3-character
>> prefixes and go with "stae".
> We have a bunch of > 3-character prefixes already: amop*, amproc*, 
> enum*, cast*. But I think I nevertheless like "ste" better.

"stx" perhaps?

I would also be in favor of changing it to something other than "sta".

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: [HACKERS] pg_statistic_ext.staenabled might not be the best column name

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Peter Eisentraut  writes:
> On 4/13/17 08:37, Heikki Linnakangas wrote:
>> We have a bunch of > 3-character prefixes already: amop*, amproc*, 
>> enum*, cast*. But I think I nevertheless like "ste" better.

> "stx" perhaps?

> I would also be in favor of changing it to something other than "sta".

"stx" sounds pretty good to me --- it seems like e.g. "stxkind" is
more visibly distinct from "stakind" than "stekind" would be.

Any objections out there?
		regards, tom lane


Re: [HACKERS] pg_statistic_ext.staenabled might not be the bestcolumn name

От:
Alvaro Herrera <alvherre@2ndquadrant.com>
Дата:
Tom Lane wrote:
> Peter Eisentraut  writes:
> > On 4/13/17 08:37, Heikki Linnakangas wrote:
> >> We have a bunch of > 3-character prefixes already: amop*, amproc*, 
> >> enum*, cast*. But I think I nevertheless like "ste" better.
> 
> > "stx" perhaps?
> 
> > I would also be in favor of changing it to something other than "sta".
> 
> "stx" sounds pretty good to me --- it seems like e.g. "stxkind" is
> more visibly distinct from "stakind" than "stekind" would be.
> 
> Any objections out there?

stx sounds good to me too.  I'll see about a patch this afternoon.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: [HACKERS] pg_statistic_ext.staenabled might not be the bestcolumn name

От:
Alvaro Herrera <alvherre@2ndquadrant.com>
Дата:
Alvaro Herrera wrote:
> Tom Lane wrote:
> > Peter Eisentraut  writes:
> > > On 4/13/17 08:37, Heikki Linnakangas wrote:
> > >> We have a bunch of > 3-character prefixes already: amop*, amproc*, 
> > >> enum*, cast*. But I think I nevertheless like "ste" better.
> > 
> > > "stx" perhaps?
> > 
> > > I would also be in favor of changing it to something other than "sta".
> > 
> > "stx" sounds pretty good to me --- it seems like e.g. "stxkind" is
> > more visibly distinct from "stakind" than "stekind" would be.
> > 
> > Any objections out there?
> 
> stx sounds good to me too.  I'll see about a patch this afternoon.

Took me a bit longer than I had hoped, but it's done now.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


FAQ