explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fZrE

Settings
# exclusive inclusive rows x rows loops node
1. 122.019 124,886.704 ↓ 43.1 1,680 1

Hash Semi Join (cost=9,174.95..5,724,017.42 rows=39 width=24) (actual time=119,670.584..124,886.704 rows=1,680 loops=1)

  • Hash Cond: ((tr.sid)::text = (rp.sid)::text)
2. 221.119 124,763.650 ↓ 4.0 425,880 1

Merge Join (cost=9,121.83..5,723,684.01 rows=106,614 width=24) (actual time=117,731.885..124,763.650 rows=425,880 loops=1)

  • Merge Cond: (t.id = ta.test_id)
3. 12.881 12.881 ↑ 1.3 44,861 1

Index Only Scan using test_pkey on test t (cost=0.41..2,018.13 rows=59,581 width=16) (actual time=0.015..12.881 rows=44,861 loops=1)

  • Heap Fetches: 3127
4. 256.120 124,529.650 ↓ 4.0 425,880 1

Materialize (cost=9,121.42..5,748,896.35 rows=106,614 width=40) (actual time=117,709.239..124,529.650 rows=425,880 loops=1)

5. 444.167 124,273.530 ↓ 4.0 425,880 1

Nested Loop (cost=9,121.42..5,748,629.81 rows=106,614 width=40) (actual time=117,709.235..124,273.530 rows=425,880 loops=1)

6. 189.563 122,977.603 ↓ 4.0 425,880 1

Nested Loop (cost=9,120.99..5,700,042.59 rows=106,614 width=50) (actual time=117,709.216..122,977.603 rows=425,880 loops=1)

7. 0.010 0.010 ↑ 1.0 1 1

Index Only Scan using test_administration_test_id on test_administration ta (cost=0.41..4.43 rows=1 width=32) (actual time=0.008..0.010 rows=1 loops=1)

  • Index Cond: (id = 'bd718f6e-c34d-11e8-a5d3-1bcd3e9ed89d'::uuid)
  • Heap Fetches: 0
8. 60,939.171 122,788.030 ↓ 4.0 425,880 1

Hash Join (cost=9,120.58..5,698,972.02 rows=106,614 width=50) (actual time=117,709.206..122,788.030 rows=425,880 loops=1)

  • Hash Cond: (r.test_registration_id = tr.id)
9. 61,842.006 61,842.006 ↓ 1.1 224,612,267 1

Seq Scan on test_registration_result r (cost=0.00..4,889,280.04 rows=213,201,404 width=41) (actual time=0.005..61,842.006 rows=224,612,267 loops=1)

10. 1.670 6.853 ↓ 1.4 3,549 1

Hash (cost=9,087.84..9,087.84 rows=2,619 width=41) (actual time=6.853..6.853 rows=3,549 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 286kB
11. 4.699 5.183 ↓ 1.4 3,549 1

Bitmap Heap Scan on test_registration tr (cost=76.73..9,087.84 rows=2,619 width=41) (actual time=0.821..5.183 rows=3,549 loops=1)

  • Recheck Cond: (test_administration_id = 'bd718f6e-c34d-11e8-a5d3-1bcd3e9ed89d'::uuid)
  • Heap Blocks: exact=2617
12. 0.484 0.484 ↓ 1.4 3,549 1

Bitmap Index Scan on test_registration_test_administration_id (cost=0.00..76.08 rows=2,619 width=0) (actual time=0.484..0.484 rows=3,549 loops=1)

  • Index Cond: (test_administration_id = 'bd718f6e-c34d-11e8-a5d3-1bcd3e9ed89d'::uuid)
13. 851.760 851.760 ↑ 1.0 1 425,880

Index Scan using question_pkey on question q (cost=0.43..0.45 rows=1 width=22) (actual time=0.002..0.002 rows=1 loops=425,880)

  • Index Cond: (id = r.question_id)
14. 0.014 1.035 ↓ 42.0 42 1

Hash (cost=53.10..53.10 rows=1 width=27) (actual time=1.035..1.035 rows=42 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
15. 0.043 1.021 ↓ 42.0 42 1

Nested Loop (cost=1.68..53.10 rows=1 width=27) (actual time=0.065..1.021 rows=42 loops=1)

  • Join Filter: ((rp.sid)::text = (s.sid)::text)
16. 0.041 0.684 ↓ 42.0 42 1

Nested Loop (cost=1.39..52.74 rows=1 width=18) (actual time=0.051..0.684 rows=42 loops=1)

17. 0.018 0.139 ↓ 42.0 42 1

Nested Loop (cost=0.83..50.65 rows=1 width=9) (actual time=0.031..0.139 rows=42 loops=1)

18. 0.025 0.025 ↑ 1.0 3 1

Index Scan using courses_pkey on courses_full (cost=0.42..25.29 rows=3 width=33) (actual time=0.011..0.025 rows=3 loops=1)

  • Index Cond: (id = ANY ('{3625fab0-8d8e-4221-a84e-0eeeb602d192,03611314-3602-4d35-99ba-b6ee25a910ab,07b01ea5-bddf-4d70-bd8e-58c611ab0a9c}'::uuid[]))
19. 0.096 0.096 ↓ 14.0 14 3

Index Scan using schedule_teacher_section on schedule c (cost=0.42..8.44 rows=1 width=43) (actual time=0.017..0.032 rows=14 loops=3)

  • Index Cond: ((course_number = courses_full.course_number) AND (section = courses_full.section) AND (teacher_number = courses_full.teacher_number))
  • Filter: (courses_full.course_name = course_name)
20. 0.504 0.504 ↑ 1.0 1 42

Index Only Scan using test_registration_sid_test_administration_id_key on test_registration rp (cost=0.56..2.08 rows=1 width=9) (actual time=0.011..0.012 rows=1 loops=42)

  • Index Cond: ((sid = (c.sid)::text) AND (test_administration_id = 'bd718f6e-c34d-11e8-a5d3-1bcd3e9ed89d'::uuid))
  • Heap Fetches: 42
21. 0.294 0.294 ↑ 1.0 1 42

Index Scan using students_sid_ix on students s (cost=0.29..0.35 rows=1 width=9) (actual time=0.006..0.007 rows=1 loops=42)

  • Index Cond: ((sid)::text = (c.sid)::text)
  • Filter: (("Gender" = 'M'::text) OR ("Gender" = 'm'::text))