Re: Postgres 15 SELECT query doesn't use index under RLS

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Postgres 15 SELECT query doesn't use index under RLS
Дата
Msg-id 1157086.1698329377@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Postgres 15 SELECT query doesn't use index under RLS  (Alexander Okulovich <aokulovich@stiltsoft.com>)
Ответы Re: Postgres 15 SELECT query doesn't use index under RLS  (Alexander Okulovich <aokulovich@stiltsoft.com>)
Список pgsql-performance
Alexander Okulovich <aokulovich@stiltsoft.com> writes:
> I've attempted to reproduce this on my PC in Docker from the stage 
> database dump, but no luck. The first query execution on Postgres 15 
> behaves like on the real stage, but subsequent ones use the index.

Can you force it in either direction with "set enable_seqscan = off"
(resp. "set enable_indexscan = off")?  If so, how do the estimated
costs compare for the two plan shapes?

> Also, 
> they execute much faster. Looks like the hardware and(or) the data 
> structure on disk matters.

Maybe your prod installation has a bloated index, and that's driving
up the estimated cost enough to steer the planner away from it.

            regards, tom lane



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

Предыдущее
От: Alexander Okulovich
Дата:
Сообщение: Re: Postgres 15 SELECT query doesn't use index under RLS
Следующее
От: Alexander Okulovich
Дата:
Сообщение: Re: Postgres 15 SELECT query doesn't use index under RLS