pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Rafal Pietrak <rafal@ztk-rp.eu>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Fwd: row level security (RLS)
Date: Mon, 15 Mar 2021 18:01:23 +0100
Message-ID: <667a19a588a9cf3a61d185e4cbe285df0a2f3cee.camel@cybertec.at> (raw)
In-Reply-To: <b355daeb-4244-c543-c420-85acb7d86fbf@ztk-rp.eu>
References: <1bd6056c-10f9-5d63-a6ec-cbd10798acf9@ztk-rp.eu>
	<b355daeb-4244-c543-c420-85acb7d86fbf@ztk-rp.eu>

On Mon, 2021-03-15 at 16:28 +0100, Rafal Pietrak wrote:
> 5. My experiments with RLS was like following:
>         - I've implemented a STABLE function, that returns INTEGER 1/0
>         - I've linked that function as POLICY to my tables
>         - I've GRANTED PUBLIC access to those tables
>         ---> and all works as predicted.... only slow (10x slower!).
>
> [lots of questions about how to solve this is some other way]
>
> Those questions come from my bad experience with POLICY performance.

You should figure out why RLS was so slow.

The key to this is "EXPLAIN (ANALYZE, BUFFERS)" for the query -
that will tell you what is slow and why, so that you can tackle the
problem.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (4+ messages)  latest in thread

Message-ID: <667a19a588a9cf3a61d185e4cbe285df0a2f3cee.camel@cybertec.at>
Permalink:  ../667a19a588a9cf3a61d185e4cbe285df0a2f3cee.camel@cybertec.at/
Also on:    postgresql.org/message-id/667a19a588a9cf3a61d185e4cbe285df0a2f3cee.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, rafal@ztk-rp.eu
  Subject: Re: Fwd: row level security (RLS)
  In-Reply-To: <667a19a588a9cf3a61d185e4cbe285df0a2f3cee.camel@cybertec.at>
  References: <1bd6056c-10f9-5d63-a6ec-cbd10798acf9@ztk-rp.eu> <b355daeb-4244-c543-c420-85acb7d86fbf@ztk-rp.eu> <667a19a588a9cf3a61d185e4cbe285df0a2f3cee.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox