explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jnUP2

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.004 0.094 ↑ 125,458.0 1 1

Merge Left Join (cost=119.10..1,438.88 rows=125,458 width=241) (actual time=0.092..0.094 rows=1 loops=1)

  • Merge Cond: (rp.id = erp.resource_permission_id)
  • Filter: ((ur.user_id = '4a66b62d-da50-4ef1-938d-abbde1fb499e'::uuid) OR (erp.entity_id = '4a66b62d-da50-4ef1-938d-abbde1fb499e'::uuid))
2. 0.002 0.053 ↑ 9,248.0 1 1

Nested Loop Left Join (cost=24.71..63.65 rows=9,248 width=209) (actual time=0.052..0.053 rows=1 loops=1)

3. 0.002 0.026 ↑ 1.0 1 1

Nested Loop (cost=0.13..9.41 rows=1 width=145) (actual time=0.025..0.026 rows=1 loops=1)

4. 0.011 0.011 ↑ 1.0 1 1

Index Scan using resource_permission_pkey on resource_permission rp (cost=0.12..8.14 rows=1 width=113) (actual time=0.010..0.011 rows=1 loops=1)

  • Filter: ((type_id IS NULL) AND (resource_id = ANY ('{4a66b62d-da50-4ef1-938d-abbde1fb499e}'::uuid[])) AND (methods && '{READ}'::resource_method[]))
5. 0.013 0.013 ↑ 1.0 1 1

Function Scan on unnest f (cost=0.00..1.25 rows=1 width=32) (actual time=0.013..0.013 rows=1 loops=1)

  • Filter: ('asd'::text ~~ f)
6. 0.020 0.025 ↓ 0.0 0 1

Hash Right Join (cost=24.59..53.77 rows=48 width=64) (actual time=0.025..0.025 rows=0 loops=1)

  • Hash Cond: (ur.role_id = rrp.role_id)
7. 0.000 0.000 ↓ 0.0 0

Seq Scan on user_role ur (cost=0.00..23.60 rows=1,360 width=32) (never executed)

8. 0.002 0.005 ↓ 0.0 0 1

Hash (cost=24.50..24.50 rows=7 width=32) (actual time=0.005..0.005 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
9. 0.002 0.003 ↓ 0.0 0 1

Bitmap Heap Scan on role_resource_permission rrp (cost=14.35..24.50 rows=7 width=32) (actual time=0.003..0.003 rows=0 loops=1)

  • Recheck Cond: (resource_permission_id = rp.id)
10. 0.001 0.001 ↓ 0.0 0 1

Bitmap Index Scan on role_resource_permission_pkey (cost=0.00..14.35 rows=7 width=0) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (resource_permission_id = rp.id)
11. 0.028 0.037 ↑ 1,360.0 1 1

Sort (cost=94.38..97.78 rows=1,360 width=32) (actual time=0.037..0.037 rows=1 loops=1)

  • Sort Key: erp.resource_permission_id
  • Sort Method: quicksort Memory: 25kB
12. 0.009 0.009 ↑ 1,360.0 1 1

Seq Scan on entity_resource_permission erp (cost=0.00..23.60 rows=1,360 width=32) (actual time=0.009..0.009 rows=1 loops=1)

Planning time : 0.665 ms