Re: GIST combo index condition chosen for users queries is different from table owner's query

2022-09-20 Thread Dennis White
Thanks. As soon as I read your reply I recalled the leakproof issue from a discussion with a former colleague years ago. At the time, I was new to Postgresql and I realize now I should have remembered that. Disabling the RLS indeed resulted in the superior plan for the test_user. The harder part w

Re: GIST combo index condition chosen for users queries is different from table owner's query

2022-09-19 Thread Tom Lane
Dennis White writes: > Is there something I can do to allow users queries to use the index with a > condition like that used for the table owner's query? It looks like the problem in your badly-optimized query is that there is not an indexable condition being extracted from the ST_INTERSECTS() ca

GIST combo index condition chosen for users queries is different from table owner's query

2022-09-19 Thread Dennis White
My project is using PostgreSQL 12.9 and has a table that gets millions of positions of ships every day. It is partitioned by tier (the importance of position) and sub-partitioned by time. We also use RLS to restrict access to rows in the table. Our problem is the query planner will not let user qu