explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jwHa

Settings
# exclusive inclusive rows x rows loops node
1. 6.052 649,728.374 ↑ 2,299.1 22 1

Nested Loop (cost=20,755,609.69..32,402,005.34 rows=50,581 width=8) (actual time=561,918.811..649,728.374 rows=22 loops=1)

  • Buffers: shared hit=3,543 read=14,605,562, temp read=1,986,727 written=1,986,727
2. 96,699.062 649,156.267 ↑ 158.5 945 1

Hash Join (cost=20,755,609.12..32,155,699.16 rows=149,777 width=20) (actual time=500,937.455..649,156.267 rows=945 loops=1)

  • Hash Cond: (cp.waybill_uuid = w.uuid)
  • Join Filter: (COALESCE((w.current_location_branch)::text, (cargo_place_history.current_branch)::text) = '75687'::text)
  • Rows Removed by Join Filter: 31,670,599
  • Buffers: shared hit=96 read=14,605,500, temp read=1,986,727 written=1,986,727
3. 75,887.934 344,143.321 ↑ 1.0 31,681,942 1

Hash Join (cost=6,828,335.57..9,668,042.77 rows=32,359,421 width=20) (actual time=81,463.450..344,143.321 rows=31,681,942 loops=1)

  • Hash Cond: (cargo_place_history.cargo_place_uuid = cp.uuid)
  • Buffers: shared hit=32 read=8,184,927, temp read=854,108 written=854,108
4. 186,808.638 186,808.638 ↓ 1.0 35,382,095 1

Index Scan using cargo_place_history_idx_is_last on cargo_place_history (cost=0.56..1,603,276.00 rows=34,903,916 width=20) (actual time=12.155..186,808.638 rows=35,382,095 loops=1)

  • Index Cond: (is_last = true)
  • Filter: is_last
  • Buffers: shared read=4,889,033
5. 25,475.255 81,446.749 ↓ 1.0 108,154,099 1

Hash (cost=4,747,138.70..4,747,138.70 rows=107,633,544 width=32) (actual time=81,446.748..81,446.749 rows=108,154,099 loops=1)

  • Buckets: 1,048,576 Batches: 128 Memory Usage: 60,958kB
  • Buffers: shared hit=32 read=3,295,894, temp written=681,099
6. 55,971.494 55,971.494 ↓ 1.0 108,154,099 1

Seq Scan on cargo_place cp (cost=0.00..4,747,138.70 rows=107,633,544 width=32) (actual time=0.395..55,971.494 rows=108,154,099 loops=1)

  • Filter: ((type)::text = 'PLAIN'::text)
  • Rows Removed by Filter: 8,081,871
  • Buffers: shared hit=32 read=3,295,894
7. 45,624.922 208,313.884 ↓ 1.0 157,438,037 1

Hash (cost=10,740,932.32..10,740,932.32 rows=156,866,019 width=36) (actual time=208,313.884..208,313.884 rows=157,438,037 loops=1)

  • Buckets: 1,048,576 Batches: 256 Memory Usage: 46,028kB
  • Buffers: shared hit=64 read=6,420,573, temp written=976,237
8. 162,688.962 162,688.962 ↓ 1.0 157,438,037 1

Seq Scan on waybill w (cost=0.00..10,740,932.32 rows=156,866,019 width=36) (actual time=0.303..162,688.962 rows=157,438,037 loops=1)

  • Filter: ((current_state <> ALL ('{16,17}'::integer[])) AND (date < (now() - '15 days'::interval)) AND (date_updated < (now() - '5 days'::interval)))
  • Rows Removed by Filter: 141,624
  • Buffers: shared hit=64 read=6,420,573
9. 566.055 566.055 ↓ 0.0 0 945

Index Only Scan using transport_schema_branch_from_branch_to_transport_schema_typ_key on transport_schema ts (cost=0.56..1.64 rows=1 width=14) (actual time=0.599..0.599 rows=0 loops=945)

  • Index Cond: ((branch_from = (cargo_place_history.current_branch)::text) AND (branch_to = (w.recipient_branch)::text) AND (transport_schema_type = w.shipping_scheme_type))
  • Filter: ((branch_to)::text <> '75687'::text)
  • Rows Removed by Filter: 0
  • Heap Fetches: 0
  • Buffers: shared hit=3,447 read=62
Planning time : 1,076.413 ms
Execution time : 649,729.130 ms