explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Berv

Settings
# exclusive inclusive rows x rows loops node
1. 10,298.609 42,181.148 ↓ 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=42,181.148..42,181.148 rows=0 loops=1)

2. 2,206.091 31,882.539 ↑ 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,776.552..31,882.539 rows=1,874,183 loops=1)

3. 9,516.989 29,676.448 ↑ 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,776.517..29,676.448 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,660.832 1,785.850 ↑ 1.0 580,644 1

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

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

6. 259.933 18,373.609 ↑ 1.2 1,882,733 1

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

7. 13,634.886 18,113.676 ↑ 1.2 1,882,733 1

Sort (cost=711,811.63..717,429.94 rows=2,247,326 width=71) (actual time=15,542.153..18,113.676 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,486.930 4,478.790 ↑ 1.2 1,882,733 1

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

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

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

  • Hash Cond: (pcont.package_id = pmmap.package_id)
10. 0.181 0.181 ↑ 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.181 rows=686 loops=1)

11. 0.024 0.131 ↑ 1.0 141 1

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

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

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

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

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

14. 0.015 0.050 ↑ 1.0 141 1

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

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

16. 1,233.710 1,990.952 ↑ 1.0 3,811,607 1

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

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