explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Z2hN

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 657.376 ↑ 1.0 1 1

Limit (cost=0.00..1,070.68 rows=1 width=182) (actual time=657.376..657.376 rows=1 loops=1)

  • Output: inbound_shipments.id, inbound_shipments.shipment_id, inbound_shipments.shipment_name, inbound_shipments.shipment_status, inbound_shipments.destination_fulfillment_center_id, inbound_shipments.created_at, inbound_shipments.updated_at, inbound_shipments.ship_from_city, inbound_shipments.ship_from_country_code, inbound_shipments.ship_from_postal_code, inbound_shipments.ship_from_name, inbound_shipments.ship_from_address_one, inbound_shipments.ship_from_address_two, inbound_shipments.ship_from_state_or_province_code, inbound_shipments.shipment_last_updated, inbound_shipments.event_date, inbound_shipments.mws_credential_id, (COALESCE(inbound_shipments.event_date, inbound_shipments.shipment_last_updated)), (date_part('day'::text, ((COALESCE(inbound_shipments.event_date, inbound_shipments.shipment_last_updated) + '270 days'::interval) - (('now'::cstring)::date)::timestamp without time zone))), ((SubPlan 1)), ((alternatives: SubPlan 2 or hashed SubPlan 3)), ((SubPlan 4)), (CASE WHEN (SubPlan 5) THEN true WHEN (SubPlan 6) THEN true ELSE false END)
  • Buffers: shared hit=85 read=106718
2. 6.984 657.376 ↑ 1,017,180.0 1 1

Seq Scan on public.inbound_shipments (cost=0.00..1,089,070,173.26 rows=1,017,180 width=182) (actual time=657.376..657.376 rows=1 loops=1)

  • Output: inbound_shipments.id, inbound_shipments.shipment_id, inbound_shipments.shipment_name, inbound_shipments.shipment_status, inbound_shipments.destination_fulfillment_center_id, inbound_shipments.created_at, inbound_shipments.updated_at, inbound_shipments.ship_from_city, inbound_shipments.ship_from_country_code, inbound_shipments.ship_from_postal_code, inbound_shipments.ship_from_name, inbound_shipments.ship_from_address_one, inbound_shipments.ship_from_address_two, inbound_shipments.ship_from_state_or_province_code, inbound_shipments.shipment_last_updated, inbound_shipments.event_date, inbound_shipments.mws_credential_id, COALESCE(inbound_shipments.event_date, inbound_shipments.shipment_last_updated), date_part('day'::text, ((COALESCE(inbound_shipments.event_date, inbound_shipments.shipment_last_updated) + '270 days'::interval) - (('now'::cstring)::date)::timestamp without time zone)), (SubPlan 1), (alternatives: SubPlan 2 or hashed SubPlan 3), (SubPlan 4), CASE WHEN (SubPlan 5) THEN true WHEN (SubPlan 6) THEN true ELSE false END
  • Buffers: shared hit=85 read=106718
3.          

SubPlan (forSeq Scan)

4. 0.007 0.024 ↑ 1.0 1 1

Aggregate (cost=1,012.22..1,012.24 rows=1 width=8) (actual time=0.024..0.024 rows=1 loops=1)

  • Output: abs(((sum((inbound_shipment_items.quantity_received - COALESCE(inbound_shipment_items.real_shipped, inbound_shipment_items.quantity_shipped))))::double precision / (COALESCE(NULLIF(sum(COALESCE(inbound_shipment_items.real_shipped, inbound_shipment_items.quantity_shipped)), 0), '1'::bigint))::double precision))
  • Buffers: shared hit=8
5. 0.003 0.017 ↑ 114.0 1 1

Nested Loop (cost=0.86..1,011.36 rows=114 width=12) (actual time=0.016..0.017 rows=1 loops=1)

  • Output: inbound_shipment_items.quantity_received, inbound_shipment_items.real_shipped, inbound_shipment_items.quantity_shipped
  • Buffers: shared hit=8
6. 0.008 0.008 ↑ 114.0 1 1

Index Scan using index_inbound_shipment_items_on_inbound_shipment_id on public.inbound_shipment_items inbound_shipment_items_1 (cost=0.43..46.92 rows=114 width=4) (actual time=0.008..0.008 rows=1 loops=1)

  • Output: inbound_shipment_items_1.id, inbound_shipment_items_1.inbound_shipment_id, inbound_shipment_items_1.listing_id, inbound_shipment_items_1.sku, inbound_shipment_items_1.fnsku, inbound_shipment_items_1.quantity_shipped, inbound_shipment_items_1.quantity_received, inbound_shipment_items_1.quantity_in_case, inbound_shipment_items_1.created_at, inbound_shipment_items_1.updated_at, inbound_shipment_items_1.real_shipped
  • Index Cond: (inbound_shipment_items_1.inbound_shipment_id = inbound_shipments.id)
  • Buffers: shared hit=4
7. 0.006 0.006 ↑ 1.0 1 1

Index Scan using inbound_shipment_items_pkey on public.inbound_shipment_items (cost=0.43..8.45 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=1)

  • Output: inbound_shipment_items.id, inbound_shipment_items.inbound_shipment_id, inbound_shipment_items.listing_id, inbound_shipment_items.sku, inbound_shipment_items.fnsku, inbound_shipment_items.quantity_shipped, inbound_shipment_items.quantity_received, inbound_shipment_items.quantity_in_case, inbound_shipment_items.created_at, inbound_shipment_items.updated_at, inbound_shipment_items.real_shipped
  • Index Cond: (inbound_shipment_items.id = inbound_shipment_items_1.id)
  • Buffers: shared hit=4
8. 0.000 0.000 ↓ 0.0 0

Index Scan using index_inbound_shipment_items_on_inbound_shipment_id on public.inbound_shipment_items inbound_shipment_items_2 (cost=0.43..46.92 rows=1 width=0) (never executed)

  • Index Cond: (inbound_shipments.id = inbound_shipment_items_2.inbound_shipment_id)
  • Filter: (inbound_shipment_items_2.real_shipped IS NOT NULL)
9. 650.348 650.348 ↑ 1.1 18,934 1

Seq Scan on public.inbound_shipment_items inbound_shipment_items_3 (cost=0.00..186,919.31 rows=21,636 width=4) (actual time=0.899..650.348 rows=18,934 loops=1)

  • Output: inbound_shipment_items_3.inbound_shipment_id
  • Filter: (inbound_shipment_items_3.real_shipped IS NOT NULL)
  • Rows Removed by Filter: 7995819
  • Buffers: shared hit=67 read=106718
10. 0.012 0.012 ↑ 114.0 1 1

Index Scan using index_inbound_shipment_items_on_inbound_shipment_id on public.inbound_shipment_items inbound_shipment_items_4 (cost=0.43..47.21 rows=114 width=0) (actual time=0.012..0.012 rows=1 loops=1)

  • Index Cond: (inbound_shipments.id = inbound_shipment_items_4.inbound_shipment_id)
  • Filter: (inbound_shipment_items_4.quantity_received <> inbound_shipment_items_4.quantity_shipped)
  • Buffers: shared hit=4
11. 0.004 0.004 ↓ 0.0 0 1

Index Only Scan using index_shipment_bols_on_inbound_shipment_id on public.shipment_bols (cost=0.28..12.09 rows=2 width=4) (actual time=0.004..0.004 rows=0 loops=1)

  • Output: shipment_bols.inbound_shipment_id
  • Index Cond: (shipment_bols.inbound_shipment_id = inbound_shipments.id)
  • Heap Fetches: 0
  • Buffers: shared hit=2
12. 0.004 0.004 ↓ 0.0 0 1

Index Only Scan using ""(transport_contents_have_tracking_url"" on public.transport_contents (cost=0.42..8.44 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=1)

  • Output: transport_contents.inbound_shipment_id
  • Index Cond: (transport_contents.inbound_shipment_id = inbound_shipments.id)
  • Heap Fetches: 0
  • Buffers: shared hit=3
Planning time : 1.260 ms
Execution time : 657.478 ms