explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hJmY

Settings
# exclusive inclusive rows x rows loops node
1. 3,950.282 19,093.025 ↓ 1.0 868,628 1

Merge Join (cost=290,684.60..396,900.55 rows=867,982 width=544) (actual time=11,497.684..19,093.025 rows=868,628 loops=1)

  • Merge Cond: ((dmdstate0_.dmd_id)::text = (distribute1_.id)::text)
  • Buffers: shared hit=715207 read=46623, temp read=30432 written=30432
  • I/O Timings: read=342.979
2. 645.731 645.731 ↑ 1.0 869,649 1

Index Scan using dmd_state_dmd_id_valid_from_idx on dmd_state dmdstate0_ (cost=0.42..72,235.10 rows=869,649 width=111) (actual time=0.010..645.731 rows=869,649 loops=1)

  • Buffers: shared hit=40992 read=24815
  • I/O Timings: read=122.721
3. 639.758 14,497.012 ↓ 1.5 868,629 1

Materialize (cost=290,684.17..293,539.75 rows=571,116 width=433) (actual time=11,497.619..14,497.012 rows=868,629 loops=1)

  • Buffers: shared hit=674215 read=21808, temp read=30432 written=30432
  • I/O Timings: read=220.258
4. 8,513.847 13,857.254 ↓ 1.0 571,230 1

Sort (cost=290,684.17..292,111.96 rows=571,116 width=433) (actual time=11,497.611..13,857.254 rows=571,230 loops=1)

  • Sort Key: distribute1_.id
  • Sort Method: external merge Disk: 243288kB
  • Buffers: shared hit=674215 read=21808, temp read=30432 written=30432
  • I/O Timings: read=220.258
5. 938.005 5,343.407 ↓ 1.0 571,230 1

Hash Join (cost=3,611.39..155,203.21 rows=571,116 width=433) (actual time=71.075..5,343.407 rows=571,230 loops=1)

  • Hash Cond: ((medicaldev2_.manufacturer_id)::text = (manufactur3_.id)::text)
  • Buffers: shared hit=674215 read=21808
  • I/O Timings: read=220.258
6. 3,841.635 4,334.420 ↓ 1.0 571,230 1

Merge Join (cost=0.85..128,748.02 rows=571,116 width=271) (actual time=0.046..4,334.420 rows=571,230 loops=1)

  • Merge Cond: ((medicaldev2_.id)::text = (distribute1_.medical_device_id)::text)
  • Buffers: shared hit=673973 read=21139
  • I/O Timings: read=216.188
7. 492.785 492.785 ↑ 1.0 553,672 1

Index Scan using mdd_pk on medical_device medicaldev2_ (cost=0.42..49,294.38 rows=553,672 width=154) (actual time=0.008..492.785 rows=553,672 loops=1)

  • Buffers: shared hit=109185 read=17116
  • I/O Timings: read=113.806
  • Filter: ((class_code)::text <> 'FAMHP'::text)
  • Rows Removed by Filter: 983
  • Buffers: shared hit=564788 read=4023
  • I/O Timings: read=102.382
8. 19.465 70.982 ↑ 1.0 26,478 1

Hash (cost=2,750.01..2,750.01 rows=26,478 width=162) (actual time=70.982..70.982 rows=26,478 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 4881kB
  • Buffers: shared hit=242 read=669
  • I/O Timings: read=4.070
9. 30.399 51.517 ↑ 1.0 26,478 1

Hash Join (cost=218.94..2,750.01 rows=26,478 width=162) (actual time=3.966..51.517 rows=26,478 loops=1)

  • Hash Cond: ((manufactur3_.company_id)::text = (company4_.id)::text)
  • Buffers: shared hit=242 read=669
  • I/O Timings: read=4.070
10. 17.212 17.212 ↑ 1.0 26,478 1

Seq Scan on manufacturer manufactur3_ (cost=0.00..1,604.34 rows=26,478 width=109) (actual time=0.033..17.212 rows=26,478 loops=1)

  • Buffers: shared hit=141 read=669
  • I/O Timings: read=4.070
11. 2.024 3.906 ↑ 1.0 1,887 1

Hash (cost=157.61..157.61 rows=1,887 width=53) (actual time=3.906..3.906 rows=1,887 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 155kB
  • Buffers: shared hit=101
12. 1.882 1.882 ↑ 1.0 1,887 1

Seq Scan on company company4_ (cost=0.00..157.61 rows=1,887 width=53) (actual time=0.012..1.882 rows=1,887 loops=1)

  • Buffers: shared hit=101
Planning time : 13.145 ms
Execution time : 19,469.887 ms