Re: [PERFORM] Row level security policy policy versus SQL constraints. Any performance difference?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PERFORM] Row level security policy policy versus SQL constraints. Any performance difference?
Дата
Msg-id 14730.1508278004@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PERFORM] Row level security policy policy versus SQLconstraints. Any performance difference?  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: [PERFORM] Row level security policy policy versus SQLconstraints. Any performance difference?  (Joe Carlson <jwcarlson@lbl.gov>)
Список pgsql-performance
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> On 10/17/2017 10:44 PM, Joe Carlson wrote:
>> What I was wondering is what is the performance differences between a
>> row level security implementation:
>> ...
>> and an implementation where I add on the constraints as part of each
>> select statement:

> The main point of the RLS is enforcing an order in which the conditions
> are evaluated.

Yeah.  Because of that, I would *not* recommend RLS if you can equally
well stick the equivalent conditions into your queries.  There is way
too much risk of taking a serious performance hit due to a bad plan.

An alternative you might consider, if simplifying the input queries
is useful, is to put the fixed conditions into a view and query the
view instead.  That way there's not an enforced evaluation order.
        regards, tom lane


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: [PERFORM] Row level security policy policy versus SQLconstraints. Any performance difference?
Следующее
От: Joe Carlson
Дата:
Сообщение: Re: [PERFORM] Row level security policy policy versus SQLconstraints. Any performance difference?