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

2023-10-31 Thread Alexander Okulovich
Hi Tom, 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? Here are the results from the prod instance: seqscan off indexscan_off

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

2023-10-26 Thread Alexander Okulovich
Hi Tom, 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. Also, they execute much faster. Looks like the hardware and(or) the data structure

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

2023-10-19 Thread Alexander Okulovich
Hi Tomek, Unfortunately, I didn't dig into this. This request is recommended to provide when describing slow query issues, but looks like it relates to JOINs in the query, which we don't have. Kin

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

2023-10-18 Thread Alexander Okulovich
here, but I didn't find them. Kind regards, Alexander On 13.10.2023 22:26, Tom Lane wrote: Alexander Okulovich writes: Recently, we upgraded the AWS RDS instance from Postgres 12.14 to 15.4 and noticed extremely high disk consumption on the following query execution: select (exists (sele

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

2023-10-18 Thread Alexander Okulovich
lar issue. We had to rebuild the indexes and it was fixed.. regards, Oscar Op do 12 okt 2023 om 18:41 schreef Alexander Okulovich : Hello everyone! Recently, we upgraded the AWS RDS instance from Postgres 12.14 to 15.4 and noticed extremely high disk consumption on the following

Postgres 15 SELECT query doesn't use index under RLS

2023-10-13 Thread Alexander Okulovich
Hello everyone! Recently, we upgraded the AWS RDS instance from Postgres 12.14 to 15.4 and noticed extremely high disk consumption on the following query execution: select (exists (select 1 as "one" from "public"."indexed_commit" where "public"."indexed_commit"."repo_id" in (964992,964994,9