explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KvjH

Settings
# exclusive inclusive rows x rows loops node
1. 392.294 29,819.488 ↑ 4,154.0 1 1

GroupAggregate (cost=2,011.63..51,009.90 rows=4,154 width=114) (actual time=29,819.488..29,819.488 rows=1 loops=1)

  • Group Key: it.item, it.warehouse
2. 20.189 29,427.194 ↓ 4.2 18,393 1

Hash Left Join (cost=2,011.63..50,691.36 rows=4,432 width=90) (actual time=144.784..29,427.194 rows=18,393 loops=1)

  • Hash Cond: ((ic.reason_code)::text = (iarc.id)::text)
  • Filter: ((ic.id IS NULL) OR ((ic.id IS NOT NULL) AND (iarc.id IS NOT NULL)))
  • Rows Removed by Filter: 26
3. 67.594 29,406.971 ↓ 4.2 18,419 1

Hash Left Join (cost=2,008.89..50,660.68 rows=4,432 width=164) (actual time=144.731..29,406.971 rows=18,419 loops=1)

  • Hash Cond: (((it.warehouse)::text = (ic.warehouse)::text) AND ((it.header_source)::text = (ic.source_entity_id)::text))
4. 29,198.217 29,323.078 ↓ 4.2 18,419 1

Bitmap Heap Scan on inventory_transaction it (cost=1,050.05..49,659.86 rows=4,432 width=127) (actual time=128.372..29,323.078 rows=18,419 loops=1)

  • Recheck Cond: (((item)::text = '5edbf421-879b-438d-94a3-5b465ad81e62'::text) AND ((warehouse)::text = 'ad771d83-a4d3-4c0b-8be6-421e3e5aa5e5'::text) AND ((type)::text = ANY ('{ProductionComponentShipment,ProductionComponentUnconsume,SalesShipment,InventoryAdjustment}'::text[])))
  • Filter: (to_char(timezone('EDT'::text, creation_date), 'yyyyMMdd'::text) >= '20171001'::text)
  • Heap Blocks: exact=18467
5. 124.861 124.861 ↓ 1.4 18,591 1

Bitmap Index Scan on idx_scm_it_item_type_wh (cost=0.00..1,048.94 rows=13,295 width=0) (actual time=124.861..124.861 rows=18,591 loops=1)

  • Index Cond: (((item)::text = '5edbf421-879b-438d-94a3-5b465ad81e62'::text) AND ((warehouse)::text = 'ad771d83-a4d3-4c0b-8be6-421e3e5aa5e5'::text) AND ((type)::text = ANY ('{ProductionComponentShipment,ProductionComponentUnconsume,SalesShipment,InventoryAdjustment}'::text[])))
6. 2.199 16.299 ↓ 1.0 5,501 1

Hash (cost=876.75..876.75 rows=5,473 width=148) (actual time=16.299..16.299 rows=5,501 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 1031kB
7. 14.100 14.100 ↓ 1.0 5,501 1

Seq Scan on inventory_counting ic (cost=0.00..876.75 rows=5,473 width=148) (actual time=0.026..14.100 rows=5,501 loops=1)

  • Filter: ((warehouse)::text = 'ad771d83-a4d3-4c0b-8be6-421e3e5aa5e5'::text)
  • Rows Removed by Filter: 4467
8. 0.006 0.034 ↑ 1.0 12 1

Hash (cost=2.59..2.59 rows=12 width=37) (actual time=0.034..0.034 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.028 0.028 ↑ 1.0 12 1

Seq Scan on inventory_adjustment_reason_code iarc (cost=0.00..2.59 rows=12 width=37) (actual time=0.017..0.028 rows=12 loops=1)

  • Filter: (used_for_consumption = 'T'::bpchar)
  • Rows Removed by Filter: 35
Planning time : 1.226 ms
Execution time : 29,819.731 ms