explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qwD7

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 21.239 ↑ 1.0 1 1

Limit (cost=0.00..1,032.06 rows=1 width=182) (actual time=21.239..21.239 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=12703
2. 7.425 21.237 ↑ 1,017,180.0 1 1

Seq Scan on public.inbound_shipments (cost=0.00..1,049,789,774.98 rows=1,017,180 width=182) (actual time=21.237..21.237 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=12703
3.          

SubPlan (forSeq Scan)

4. 0.008 0.025 ↑ 1.0 1 1

Aggregate (cost=1,012.22..1,012.24 rows=1 width=8) (actual time=0.025..0.025 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.002 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.010 0.010 ↑ 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.009..0.010 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.005 0.005 ↑ 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.005..0.005 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 Only Scan using filtered_where_real_shipped on public.inbound_shipment_items inbound_shipment_items_2 (cost=0.29..8.30 rows=1 width=0) (never executed)

  • Index Cond: (inbound_shipment_items_2.inbound_shipment_id = inbound_shipments.id)
  • Heap Fetches: 0
9. 13.751 13.751 ↑ 1.1 18,934 1

Index Only Scan using filtered_where_real_shipped on public.inbound_shipment_items inbound_shipment_items_3 (cost=0.29..6,982.33 rows=21,640 width=4) (actual time=0.025..13.751 rows=18,934 loops=1)

  • Output: inbound_shipment_items_3.inbound_shipment_id
  • Heap Fetches: 18934
  • Buffers: shared hit=12685
10. 0.022 0.022 ↑ 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.022..0.022 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.007 0.007 ↓ 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.007..0.007 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.007 0.007 ↓ 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.007..0.007 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 : 0.896 ms
Execution time : 21.352 ms