Quick question about RLS join policies
Hello! I remember seeing a post somewhere about increasing the performance of RLS by improving the performance of the queries, and it went something like this with joins:
Bad:
Good:
Bad:
Good:
using (
(select auth.uid()) in (
select user_id from public.access_control
where role = 'admin'
)
)using (
select user_id from public.access_control
where user_id = (select auth.uid()) and role = 'admin'
)
)