pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ancoron Luciferis <ancoron.luciferis@googlemail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Custom opclass for column statistics?
Date: Wed, 10 Jul 2019 00:16:38 +0200
Message-ID: <ac9a8640-c421-7662-5e0c-05648c926176@googlemail.com> (raw)
In-Reply-To: <26689.1562421538@sss.pgh.pa.us>
References: <b0590dd1-5bfb-ad62-c4d0-a7057c04a68b@googlemail.com>
	<26689.1562421538@sss.pgh.pa.us>

On 06/07/2019 15:58, Tom Lane wrote:
> Ancoron Luciferis <ancoron.luciferis@googlemail.com> writes:
>> I've been wondering whether it is possible somehow to have the standard
>> column statistics to respect a certain operator class?
> 
> In principle, pg_statistic can represent stats for a non-default opclass.
> Teaching ANALYZE to collect such stats when appropriate, and then teaching
> the planner to use them when appropriate, is left as an exercise for the
> reader.

Hehe, now that you are saying it, I realize what I was actually asking
for with this... ;)

> 
> I think the "when appropriate" bit is actually the hardest part of that.
> Possibly, if you were satisfied with a relatively manual approach,
> you could proceed by using CREATE STATISTICS to declare interest in
> keeping standard stats for a non-default sort order.  Not sure what to
> do if you want it to be automatic, because I don't think people would
> hold still for having ANALYZE collect stats for any random non-default
> opclass automatically.  Maybe a new opclass property?

I totally agree with the complications around all that.

Now I think if I want better statistics and better plans for my new
time-sorted index, I will need a new data type for which I can set the
opclass as default, which also would provide users the guarantee that
they'll get what they expect.

Thanx and cheers,

	Ancoron





view thread (7+ messages)

Message-ID: <ac9a8640-c421-7662-5e0c-05648c926176@googlemail.com>
Permalink:  ../ac9a8640-c421-7662-5e0c-05648c926176@googlemail.com/
Also on:    postgresql.org/message-id/ac9a8640-c421-7662-5e0c-05648c926176@googlemail.com

 · 

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-performance@postgresql.org
  Cc: ancoron.luciferis@googlemail.com, tgl@sss.pgh.pa.us, pgsql-performance@lists.postgresql.org
  Subject: Re: Custom opclass for column statistics?
  In-Reply-To: <ac9a8640-c421-7662-5e0c-05648c926176@googlemail.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