explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9tr

Settings
# exclusive inclusive rows x rows loops node
1. 1.771 14.209 ↑ 10.7 1,200 1

Nested Loop (cost=66.11..8,974.42 rows=12,809 width=162) (actual time=0.546..14.209 rows=1,200 loops=1)

2. 0.335 11.133 ↓ 1.0 1,305 1

Nested Loop Left Join (cost=65.83..5,054.63 rows=1,285 width=125) (actual time=0.526..11.133 rows=1,305 loops=1)

3. 0.458 5.578 ↓ 1.0 1,305 1

Nested Loop Left Join (cost=65.41..4,467.78 rows=1,285 width=93) (actual time=0.525..5.578 rows=1,305 loops=1)

4. 0.475 2.620 ↑ 1.0 500 1

Nested Loop (cost=64.98..4,058.01 rows=500 width=76) (actual time=0.521..2.620 rows=500 loops=1)

5. 0.239 0.645 ↑ 1.0 500 1

HashAggregate (cost=64.56..69.56 rows=500 width=16) (actual time=0.515..0.645 rows=500 loops=1)

  • Group Key: users.user_id
6. 0.055 0.406 ↑ 1.0 500 1

Limit (cost=0.42..58.31 rows=500 width=16) (actual time=0.017..0.406 rows=500 loops=1)

7. 0.351 0.351 ↑ 897.9 500 1

Index Only Scan using users_pkey on users (cost=0.42..51,977.36 rows=448,942 width=16) (actual time=0.016..0.351 rows=500 loops=1)

  • Index Cond: (user_id > '00000000-0000-0000-0000-000000000000'::uuid)
  • Heap Fetches: 418
8. 1.500 1.500 ↑ 1.0 1 500

Index Scan using users_pkey on users u (cost=0.42..7.99 rows=1 width=76) (actual time=0.003..0.003 rows=1 loops=500)

  • Index Cond: (user_id = users.user_id)
9. 2.500 2.500 ↑ 2.0 3 500

Index Scan using enrollments_user_id_index on enrollments e (cost=0.43..0.76 rows=6 width=33) (actual time=0.003..0.005 rows=3 loops=500)

  • Index Cond: (user_id = u.user_id)
10. 5.220 5.220 ↑ 1.0 1 1,305

Index Scan using classes_pkey on classes c (cost=0.42..0.46 rows=1 width=48) (actual time=0.004..0.004 rows=1 loops=1,305)

  • Index Cond: (class_id = e.class_id)
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 0
11. 1.305 1.305 ↑ 10.0 1 1,305

Index Scan using orgs_pkey on orgs o (cost=0.28..2.95 rows=10 width=37) (actual time=0.001..0.001 rows=1 loops=1,305)

  • Index Cond: (org_id = ANY (u.org_ids))
Planning time : 0.681 ms
Execution time : 14.370 ms