Re: GIST/GIN index not used with Row Level Security

Поиск
Список
Период
Сортировка
От Derek Hans
Тема Re: GIST/GIN index not used with Row Level Security
Дата
Msg-id CAGrP7a3ZZ5MaMi3LLmPy121K_YDYCkinu2gcq8PQzQqpGUuEkQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: GIST/GIN index not used with Row Level Security  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: GIST/GIN index not used with Row Level Security  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: GIST/GIN index not used with Row Level Security  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-general
Thanks for the pointer for marking functions as leakproof, I was unaware of that whole concept. 

Unfortunately only "alter function" supports "leakproof" - "alter operator" does not. Is there a function-equivalent for marking operators as leakproof? Is there any documentation for which operators/functions are leakproof?

In my particular case, RLS is still useful even if operators are leaky as I control the application code and therefore can ensure leaky errors are handled. If it's possible to disable all checking for "leakproof", that would work for me. 

> If that's not possible, it sounds like it
> effectively blocks the use of GIN/GIST indexes when RLS is in use.

There's a whole lot of daylight between "it doesn't pick an indexscan in
this one example" and "it effectively blocks the use of GIN/GIST".

True indeed :). Would you have a working example of using a GIN/GIST index with RLS? All the attempts I've made have ended in seq scans. In practice, I'm looking to implement fuzzy search using trigrams, so % and %> operators are what matter to me. ~~ also happens to fail. Should I expect to be able to use any of these with RLS, large amounts of data and reasonable performance? 

Your description of leakproof (and the documentation I've found) makes it sound like I'm not just hitting an isolated problem, but a general problem with RLS that represents a substantial limitation and is likely worth documenting. 
 
--

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: GIST/GIN index not used with Row Level Security
Следующее
От: Tom Lane
Дата:
Сообщение: Re: GIST/GIN index not used with Row Level Security