explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bHA : RLS with ACL in GIN column without public condition on pg@10.4, 1000 users

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.120 6.794 ↑ 1.0 1 1

Aggregate (cost=120,766.03..120,766.04 rows=1 width=8) (actual time=6.794..6.794 rows=1 loops=1)

2. 6.360 6.674 ↑ 58.6 1,269 1

Bitmap Heap Scan on items (cost=740.70..120,579.98 rows=74,420 width=0) (actual time=0.456..6.674 rows=1,269 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=1,252
3. 0.000 0.314 ↓ 0.0 0 1

BitmapOr (cost=740.70..740.70 rows=74,596 width=0) (actual time=0.314..0.314 rows=0 loops=1)

4. 0.077 0.077 ↑ 59.3 278 1

Bitmap Index Scan on read_permissions_index (cost=0.00..167.58 rows=16,476 width=0) (actual time=0.077..0.077 rows=278 loops=1)

  • Index Cond: (acl_read && (regexp_split_to_array(current_setting('jwt.claims.roles'::text), ','::text))::uuid[])
5. 0.237 0.237 ↑ 58.1 1,000 1

Bitmap Index Scan on write_permissions_index (cost=0.00..535.91 rows=58,120 width=0) (actual time=0.237..0.237 rows=1,000 loops=1)

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