explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7FEV : RLS with ACL in GIN column without public condition on pg@10.4, 100 users

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.093 0.820 ↑ 1.0 1 1

Aggregate (cost=1,961.15..1,961.16 rows=1 width=8) (actual time=0.819..0.820 rows=1 loops=1)

2. 0.544 0.727 ↓ 1.0 1,078 1

Bitmap Heap Scan on items (cost=32.58..1,958.47 rows=1,069 width=0) (actual time=0.226..0.727 rows=1,078 loops=1)

  • Recheck Cond: ((acl_read && (regexp_split_to_array(current_setting('jwt.claims.roles'::text), ','::text))::uuid[]) OR (acl_write && (regexp_split_to_array(current_setting('jwt.claims.roles'::text), ','::text))::uuid[]))
  • Heap Blocks: exact=311
3. 0.001 0.183 ↓ 0.0 0 1

BitmapOr (cost=32.58..32.58 rows=1,070 width=0) (actual time=0.183..0.183 rows=0 loops=1)

4. 0.057 0.057 ↓ 1.1 91 1

Bitmap Index Scan on read_permissions_index (cost=0.00..12.61 rows=80 width=0) (actual time=0.057..0.057 rows=91 loops=1)

  • Index Cond: (acl_read && (regexp_split_to_array(current_setting('jwt.claims.roles'::text), ','::text))::uuid[])
5. 0.125 0.125 ↓ 1.0 1,000 1

Bitmap Index Scan on write_permissions_index (cost=0.00..19.43 rows=990 width=0) (actual time=0.125..0.125 rows=1,000 loops=1)

  • Index Cond: (acl_write && (regexp_split_to_array(current_setting('jwt.claims.roles'::text), ','::text))::uuid[])
Planning time : 0.305 ms
Execution time : 0.864 ms