explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YpBn : Optimization for: plan #QVnY

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.003 0.435 ↑ 1.0 15 1

Limit (cost=1.33..22.98 rows=15 width=2,839) (actual time=0.067..0.435 rows=15 loops=1)

  • Buffers: shared hit=208
2. 0.056 0.432 ↑ 7,600.1 15 1

Nested Loop Semi Join (cost=1.33..164,580.13 rows=114,001 width=2,839) (actual time=0.066..0.432 rows=15 loops=1)

  • Buffers: shared hit=208
3. 0.070 0.070 ↑ 7,693.6 34 1

Index Scan using index_users_on_sortable_name_old2 on users (cost=0.42..46,138.99 rows=261,582 width=2,807) (actual time=0.010..0.070 rows=34 loops=1)

  • Filter: ((workflow_state)::text <> 'deleted'::text)
  • Buffers: shared hit=34
4. 0.018 0.306 ↓ 0.0 0 34

Hash Join (cost=0.90..1.57 rows=1 width=16) (actual time=0.009..0.009 rows=0 loops=34)

  • Hash Cond: (enrollments.user_id = user_account_associations.user_id)
  • Buffers: shared hit=174
5. 0.133 0.133 ↑ 10.0 1 19

Index Scan using index_enrollments_on_role_id_and_user_id on enrollments (cost=0.43..1.07 rows=10 width=8) (actual time=0.007..0.007 rows=1 loops=19)

  • Index Cond: ((role_id = 3) AND (user_id = users.id))
  • Filter: ((workflow_state)::text <> ALL ('{rejected,deleted,inactive}'::text[]))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=80
6. 0.031 0.155 ↑ 1.0 1 31

Hash (cost=0.46..0.46 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=31)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=94
7. 0.124 0.124 ↑ 1.0 1 31

Index Only Scan using index_user_account_associations_on_user_id_and_account_id on user_account_associations (cost=0.42..0.46 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=31)

  • Index Cond: ((user_id = users.id) AND (account_id = 32))
  • Heap Fetches: 0
  • Buffers: shared hit=94
Planning time : 0.529 ms
Execution time : 0.507 ms