explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rL05

Settings
# exclusive inclusive rows x rows loops node
1. 9,898.682 41,551.890 ↓ 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=41,551.890..41,551.890 rows=0 loops=1)

2. 2,193.978 31,653.208 ↑ 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=17,242.986..31,653.208 rows=1,874,183 loops=1)

3. 9,141.697 29,459.230 ↑ 1.2 1,874,183 1

Merge Join (cost=805,436.88..1,415,873.11 rows=2,219,069 width=73) (actual time=17,242.940..29,459.230 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,572.269 1,695.095 ↑ 1.0 580,644 1

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

  • Sort Key: pc.package_id, pc.bed_type, pc.org_id
  • Sort Method: external merge Disk: 23992kB
5. 122.826 122.826 ↑ 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.003..122.826 rows=580,644 loops=1)

6. 259.573 18,622.438 ↑ 1.2 1,882,733 1

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

7. 13,969.363 18,362.865 ↑ 1.2 1,882,733 1

Sort (cost=711,811.63..717,429.94 rows=2,247,326 width=71) (actual time=16,022.866..18,362.865 rows=1,882,733 loops=1)

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

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

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

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

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

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

11. 0.033 0.176 ↑ 1.0 141 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 7kB
12. 0.057 0.143 ↑ 1.0 141 1

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

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

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

14. 0.027 0.045 ↑ 1.0 141 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 6kB
15. 0.018 0.018 ↑ 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.005..0.018 rows=141 loops=1)

16. 1,237.203 1,996.934 ↑ 1.0 3,811,607 1

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

  • Buckets: 2048 Batches: 2048 (originally 256) Memory Usage: 1025kB
17. 759.731 759.731 ↑ 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.262..759.731 rows=3,811,607 loops=1)