Re: PostgreSQL 10.0 SELECT LIMIT performance problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PostgreSQL 10.0 SELECT LIMIT performance problem
Дата
Msg-id 12108.1536860530@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RE: PostgreSQL 10.0 SELECT LIMIT performance problem  (Mareks Kalnačs <Mareks.Kalnacs@datakom.lv>)
Ответы RE: PostgreSQL 10.0 SELECT LIMIT performance problem
Список pgsql-bugs
=?utf-8?B?TWFyZWtzIEthbG5hxI1z?= <Mareks.Kalnacs@datakom.lv> writes:
> But we are using value indexes not a json index:

> CREATE INDEX idx_oss_alarms_dn
>   ON oss_alarms
>   USING btree
>   ((jdata ->> 'dn'::text) COLLATE pg_catalog."default");

I think you're outsmarting yourself by including those COLLATE clauses.
They don't do anything, since they're just selecting the default behavior
--- but they're enough to make the planner not realize that stats
collected on the index expression would be applicable to a plain
reference to oss_alarms.jdata ->> 'dn'.  In general you want the index
expression to be spelled exactly the same way that you refer to the
value in queries, else the system may not realize it's relevant.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15382: Error create dictionary in pg_dump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15383: Join Filter cost estimation problem in 10.5