pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tels <nospam-pg-abuse@bloodgate.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: WITH clause in CREATE STATISTICS
Date: Fri, 21 Apr 2017 09:52:05 -0400
Message-ID: <30cb51463a0ede7ce706c958537dca3a.squirrel@sm.webmail.pair.com> (raw )
In-Reply-To: <CAKJS1f9D2fX0nP2ti6EkWmrXB29EqawyiCqFFeJ0qCj4x6VvNA@mail.gmail.com >
References: <20170420212426.ltvgyhnefvhixm6i@alvherre.pgsql >
<22269.1492726397@sss.pgh.pa.us >
<724d39fc-b7e9-7634-21e1-ebdba6f73bd6@2ndquadrant.com >
<703b449ecd188a16d5e12a1fcb6158bf.squirrel@sm.webmail.pair.com >
<CAKJS1f9D2fX0nP2ti6EkWmrXB29EqawyiCqFFeJ0qCj4x6VvNA@mail.gmail.com >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Moin,
On Fri, April 21, 2017 7:04 am, David Rowley wrote:
> On 21 April 2017 at 22:30, Tels <nospam-pg-abuse@bloodgate.com> wrote:
>> I'd rather see:
>>
>> CREATE STATISTICS stats_name ON table(col);
>>
>> as this both mirrors CREATE INDEX and foreign keys with REFERENCES. It
>> could also be extended to both more columns, expressions or other tables
>> like so:
>>
>> CREATE STATISTICS stats ON t1(col1, col2 / 2), t2 (a,b);
>>
>> and even:
>>
>> CREATE STATISTICS stats ON t1(col1, col2 / 2), t2 (a,b) WITH (options)
>> WHERE t2.a > 4;
>
> How would you express a join condition with that syntax?
>
>> This looks easy to remember, since it compares to:
>>
>> CREATE INDEX idx_name ON t2(a,b) WITH (options) WHERE t2.a > 4;
>>
>> Or am I'm missing something?
>
> Sadly yes, you are, and it's not the first time.
>
> I seem to remember mentioning this to you already in [1].
>
> Please, can you read over [2], it mentions exactly what you're
> proposing and why it's not any good.
>
> [1]
> https://www.postgresql.org/message-id/CAKJS1f9HMeT+7adicEaU8heOMpOB5pKkCVYZLiEZje3DVutVPw@mail.gmail...
> [2]
> https://www.postgresql.org/message-id/CAEZATCUtGR+U5+QTwjHhe9rLG2nguEysHQ5NaqcK=VbJ78VQFA@mail.gmail...
Ah, ok, thank you, somehow I missed your answer the first time. So, just
ignore me :)
Best wishes,
Tels
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
view thread (45+ messages) latest in thread
Message-ID: <30cb51463a0ede7ce706c958537dca3a.squirrel@sm.webmail.pair.com>
Permalink: ../30cb51463a0ede7ce706c958537dca3a.squirrel@sm.webmail.pair.com/
Also on: postgresql.org/message-id/30cb51463a0ede7ce706c958537dca3a.squirrel@sm.webmail.pair.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nospam-pg-abuse@bloodgate.com, david.rowley@2ndquadrant.com, tomas.vondra@2ndquadrant.com
Subject: Re: WITH clause in CREATE STATISTICS
In-Reply-To: <30cb51463a0ede7ce706c958537dca3a.squirrel@sm.webmail.pair.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox