Re: Proposition for autoname columns

From: Eugen Konkov <kes-kes(at)yandex(dot)ru>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposition for autoname columns
Date: 2020-11-12 20:13:08
Message-ID: 836168461.20201112221308@yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On 2020-Nov-12, Tom Lane wrote:

>> On the whole, I'm on the side of the people who don't want to change this.
>> The implementation cost seems likely to greatly outweigh the value, plus
>> it feels more like a wart than a feature.

> I think if Eugen wants to spend some time with it and see how it could
> be implemented, then sent a patch for consideration, then we could make
> a better informed decision. My own opinion is that it's not worth the
> trouble, but I'd rather us not stand in his way if he wants to try
> (With disclaimer that we might end up not liking the patch, of course).

Sorry, I am not C/C++ programmist and do not imagine how to start to patch.
I do not know internals of PG. The only useful thing from me is just that idea
to make world better.

I suppose initially there were only ?column?, later names were implemented for count, sum etc
But it will be cool if PG will do step further and name sum( a ) as sum_a instead of just sum

The purpose of this proposition is not about correct name generation, the purpose to get
more distinct default names:
?column?, ?column?, ?column?, ?column?, ?column?, ?column?, ?column?,

?count?, ?count?, ?count?, ?sum?, ?sum?, ?sum?, ?sum?

?count_a?, ?count_b?, ?count_c?, ?sum_a?, ?sum_b?, ?sum_c?, ?sum_d?

Notice, that latest is more robust that first ;-)

I suppose we just ignore comlex cases and left them as they are
current. We could try some very very small step at the direction to
improve default names and see feed back from many users how it is
useful or not. Then we can decide it worth or not to implement whole
system for default name generation.

Unfortunately I am not judje at which level those should occur: parser, analiser or so.
I just does not understand those things =(

Thank you.

--
Best regards,
Eugen Konkov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-11-12 20:14:34 Re: avoid bitmapOR-ing indexes with scan condition inconsistent with partition constraint
Previous Message e.sokolova 2020-11-12 20:10:05 Re: [PATCH] Add extra statistics to explain for Nested Loop