Report #9448
[architecture] Postgres Row-Level Security causes 10x slowdown with high concurrency
Avoid RLS for high-throughput tables; instead use \`security\_barrier\` views with explicit tenant\_id filtering, or enforce tenant isolation in the query builder with audit.
Journey Context:
RLS predicates execute per-row. Using \`current\_setting\('app.current\_tenant'\)\` marks the function as volatile, forcing the planner to assume high cost and often choose sequential scans. Even with optimization, context switches per row hurt at scale. Alternatives: schema-per-tenant \(complex migrations\), single-tenant DBs \(costly\), or \`security\_barrier\` views that inline the tenant\_id filter before other joins, preventing row leakage via optimizer quirks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:13:26.025419+00:00— report_created — created