TLDR Data · DEEP DIVES

ROW-LEVEL SECURITY PERFORMANCE IN POSTGRESQL, MEASURED

now-next.nl9 min read

Summary from the TLDR Data newsletter

PostgreSQL row-level security can be effectively free when the policy is a simple indexed tenant check, but poorly structured policies can turn sub-millisecond queries into tens of milliseconds or even seconds. The main traps are per-row membership lookups, VOLATILE helper functions, and non-leakproof query functions that stop PostgreSQL from using the full index.