explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ksDK

Settings
# exclusive inclusive rows x rows loops node
1. 4,340.101 34,566.358 ↓ 0.0 0 1

Insert on temp_package_content_charges (cost=805,436.88..1,460,254.49 rows=2,219,069 width=90) (actual time=34,566.358..34,566.358 rows=0 loops=1)

2. 2,023.003 30,226.257 ↑ 1.2 1,874,183 1

Subquery Scan on *SELECT* (cost=805,436.88..1,460,254.49 rows=2,219,069 width=90) (actual time=16,679.036..30,226.257 rows=1,874,183 loops=1)

3. 8,438.672 28,203.254 ↑ 1.2 1,874,183 1

Merge Join (cost=805,436.88..1,415,873.11 rows=2,219,069 width=73) (actual time=16,678.987..28,203.254 rows=1,874,183 loops=1)

  • Merge Cond: ((pc.package_id = pm.package_id) AND ((pc.bed_type)::text = (dc.bed_type)::text) AND ((pc.org_id)::text = (dc.org_name)::text))
4. 1,557.845 1,682.468 ↑ 1.0 580,644 1

Sort (cost=93,625.25..95,076.86 rows=580,644 width=30) (actual time=1,220.612..1,682.468 rows=580,644 loops=1)

  • Sort Key: pc.package_id, pc.bed_type, pc.org_id
  • Sort Method: external merge Disk: 23992kB
5. 124.623 124.623 ↑ 1.0 580,644 1

Seq Scan on package_charges pc (cost=0.00..10,246.44 rows=580,644 width=30) (actual time=0.002..124.623 rows=580,644 loops=1)

6. 254.536 18,082.114 ↑ 1.2 1,882,733 1

Materialize (cost=711,811.63..723,048.26 rows=2,247,326 width=71) (actual time=15,458.138..18,082.114 rows=1,882,733 loops=1)

7. 13,315.622 17,827.578 ↑ 1.2 1,882,733 1

Sort (cost=711,811.63..717,429.94 rows=2,247,326 width=71) (actual time=15,458.133..17,827.578 rows=1,882,733 loops=1)

  • Sort Key: pm.package_id, dc.bed_type, dc.org_name
  • Sort Method: external merge Disk: 154576kB
8. 2,415.202 4,511.956 ↑ 1.2 1,882,733 1

Hash Join (cost=145,064.42..198,193.23 rows=2,247,326 width=71) (actual time=2,113.129..4,511.956 rows=1,882,733 loops=1)

  • Hash Cond: ((pcont.activity_id)::text = (dc.test_id)::text)
9. 0.524 0.795 ↓ 1.0 651 1

Hash Join (cost=13.26..40.93 rows=624 width=48) (actual time=0.158..0.795 rows=651 loops=1)

  • Hash Cond: (pcont.package_id = pmmap.package_id)
10. 0.134 0.134 ↑ 1.0 686 1

Seq Scan on temp_package_contents pcont (cost=0.00..18.86 rows=686 width=40) (actual time=0.008..0.134 rows=686 loops=1)

11. 0.018 0.137 ↑ 1.0 141 1

Hash (cost=11.50..11.50 rows=141 width=12) (actual time=0.137..0.137 rows=141 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 7kB
12. 0.041 0.119 ↑ 1.0 141 1

Hash Join (cost=4.17..11.50 rows=141 width=12) (actual time=0.047..0.119 rows=141 loops=1)

  • Hash Cond: (pm.package_id = pmmap.pack_master_id)
13. 0.042 0.042 ↑ 1.4 155 1

Seq Scan on pack_master pm (cost=0.00..5.12 rows=212 width=4) (actual time=0.003..0.042 rows=155 loops=1)

14. 0.019 0.036 ↑ 1.0 141 1

Hash (cost=2.41..2.41 rows=141 width=8) (actual time=0.036..0.036 rows=141 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 6kB
15. 0.017 0.017 ↑ 1.0 141 1

Seq Scan on temp_pack_master_packages_mapping pmmap (cost=0.00..2.41 rows=141 width=8) (actual time=0.004..0.017 rows=141 loops=1)

16. 1,320.557 2,095.959 ↑ 1.0 3,811,607 1

Hash (cost=71,350.07..71,350.07 rows=3,811,607 width=31) (actual time=2,095.959..2,095.959 rows=3,811,607 loops=1)

  • Buckets: 2048 Batches: 2048 (originally 256) Memory Usage: 1025kB
17. 775.402 775.402 ↑ 1.0 3,811,607 1

Seq Scan on diagnostic_charges dc (cost=0.00..71,350.07 rows=3,811,607 width=31) (actual time=0.974..775.402 rows=3,811,607 loops=1)