explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PM67

Settings
# exclusive inclusive rows x rows loops node
1. 785.977 4,432.926 ↑ 1.0 423,444 1

Hash Join (cost=2,960.78..3,715,694.74 rows=423,444 width=690) (actual time=22.879..4,432.926 rows=423,444 loops=1)

  • Hash Cond: (events.programs_id = programs.id)
  • Buffers: shared hit=2641549 read=73752
2. 289.112 2,376.233 ↑ 1.0 423,444 1

Hash Join (cost=2,919.64..131,729.44 rows=423,444 width=526) (actual time=22.476..2,376.233 rows=423,444 loops=1)

  • Hash Cond: (claims_1.staffing_users_id = staffing_users.id)
  • Buffers: shared hit=960291 read=61000
3. 233.900 2,064.860 ↑ 1.0 423,444 1

Hash Join (cost=78.55..123,066.00 rows=423,444 width=526) (actual time=0.170..2,064.860 rows=423,444 loops=1)

  • Hash Cond: (claims_1.payroll_periods_id = payroll_periods.id)
  • Buffers: shared hit=960289 read=59106
4. 595.602 1,830.906 ↑ 1.0 423,444 1

Merge Join (cost=72.85..117,237.94 rows=423,444 width=518) (actual time=0.109..1,830.906 rows=423,444 loops=1)

  • Merge Cond: (claims_1.events_id = events.id)
  • Buffers: shared hit=960288 read=59104
5. 523.405 523.405 ↑ 1.0 423,444 1

Index Scan using claims_events_id_idx on claims claims_1 (cost=0.42..43,146.11 rows=423,444 width=466) (actual time=0.006..523.405 rows=423,444 loops=1)

  • Buffers: shared hit=350413 read=22957
6. 711.899 711.899 ↓ 1.2 1,230,104 1

Index Scan using events_pkey on events (cost=0.43..66,221.03 rows=1,058,835 width=56) (actual time=0.005..711.899 rows=1,230,104 loops=1)

  • Buffers: shared hit=609875 read=36147
7. 0.027 0.054 ↑ 1.0 120 1

Hash (cost=4.20..4.20 rows=120 width=12) (actual time=0.054..0.054 rows=120 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
  • Buffers: shared hit=1 read=2
8. 0.027 0.027 ↑ 1.0 120 1

Seq Scan on payroll_periods (cost=0.00..4.20 rows=120 width=12) (actual time=0.006..0.027 rows=120 loops=1)

  • Buffers: shared hit=1 read=2
9. 10.554 22.261 ↑ 1.0 42,004 1

Hash (cost=2,316.04..2,316.04 rows=42,004 width=4) (actual time=22.261..22.261 rows=42,004 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 1989kB
  • Buffers: shared hit=2 read=1894
10. 11.707 11.707 ↑ 1.0 42,004 1

Seq Scan on staffing_users (cost=0.00..2,316.04 rows=42,004 width=4) (actual time=0.006..11.707 rows=42,004 loops=1)

  • Buffers: shared hit=2 read=1894
11. 0.150 0.384 ↑ 1.0 673 1

Hash (cost=32.73..32.73 rows=673 width=36) (actual time=0.384..0.384 rows=673 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 56kB
  • Buffers: shared hit=2 read=24
12. 0.234 0.234 ↑ 1.0 673 1

Seq Scan on programs (cost=0.00..32.73 rows=673 width=36) (actual time=0.007..0.234 rows=673 loops=1)

  • Buffers: shared hit=2 read=24
13.          

SubPlan (forHash Join)

14. 1,270.332 1,270.332 ↑ 1.0 1 423,444

Index Scan using events_staffing_days_positions_pkey on events_staffing_days_positions (cost=0.43..8.45 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=423,444)

  • Index Cond: (id = claims_1.events_staffing_days_positions_id)
  • Buffers: shared hit=1681256 read=12728