Re: Custom opclass for column statistics?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Custom opclass for column statistics?
Дата
Msg-id 26689.1562421538@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Custom opclass for column statistics?  (Ancoron Luciferis <ancoron.luciferis@googlemail.com>)
Ответы Re: Custom opclass for column statistics?  (Ancoron Luciferis <ancoron.luciferis@googlemail.com>)
Список pgsql-performance
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.

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?

            regards, tom lane



В списке pgsql-performance по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Custom opclass for column statistics?
Следующее
От: Ancoron Luciferis
Дата:
Сообщение: Re: Custom opclass for column statistics?