explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XQnK

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 11.556 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.56..4,123.28 rows=71 width=2,052) (actual time=11.556..11.556 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number, cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock, s.name, s.created_at, s.id, s.length, s.width, s.location_id, s.site_key, s.version, s.ship_type, s.discriminator, s.mmsi, s.call_sign, ss.local_clock, ss.version, ss.location_id, ss.site_id, ss.lat, ss.names, ss.eta, ss.remote_clock, ss.lon, ss.discriminator, ss.draught, ss.last_time, ss.first_time, ss.id, sp.latitude, sp.region, sp.country, sp.address_line1, sp.state, sp.id, sp.address_line2, sp.location_name, sp.postal_code, sp.discriminator, sp.port_code, sp.longitude, sp.city, sp.time_zone_id, ssp.latitude, ssp.address_line1, ssp.country, ssp.address_line2, ssp.state, ssp.longitude, ssp.region, ssp.id, ssp.port_code, ssp.location_name, ssp.city, ssp.discriminator, ssp.postal_code, ssp.time_zone_id, dp.postal_code, dp.address_line2, dp.location_name, dp.id, dp.discriminator, dp.region, dp.country, dp.state, dp.port_code, dp.address_line1, dp.latitude, dp.city, dp.longitude, dp.time_zone_id, op.longitude, op.time_zone_id, op.address_line1, op.postal_code, op.region, op.country, op.city, op.latitude, op.state, op.id, op.address_line2, op.location_name, op.discriminator, op.port_code, lp.time_zone_id, lp.port_code, lp.id, lp.address_line1, lp.longitude, lp.city, lp.latitude, lp.state, lp.postal_code, lp.country, lp.address_line2, lp.location_name, lp.discriminator, lp.region
2. 0.001 11.555 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.13..3,522.80 rows=71 width=1,786) (actual time=11.555..11.555 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number, cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock, s.name, s.created_at, s.id, s.length, s.width, s.location_id, s.site_key, s.version, s.ship_type, s.discriminator, s.mmsi, s.call_sign, sp.latitude, sp.region, sp.country, sp.address_line1, sp.state, sp.id, sp.address_line2, sp.location_name, sp.postal_code, sp.discriminator, sp.port_code, sp.longitude, sp.city, sp.time_zone_id, ss.local_clock, ss.version, ss.location_id, ss.site_id, ss.lat, ss.names, ss.eta, ss.remote_clock, ss.lon, ss.discriminator, ss.draught, ss.last_time, ss.first_time, ss.id, ssp.latitude, ssp.address_line1, ssp.country, ssp.address_line2, ssp.state, ssp.longitude, ssp.region, ssp.id, ssp.port_code, ssp.location_name, ssp.city, ssp.discriminator, ssp.postal_code, ssp.time_zone_id, dp.postal_code, dp.address_line2, dp.location_name, dp.id, dp.discriminator, dp.region, dp.country, dp.state, dp.port_code, dp.address_line1, dp.latitude, dp.city, dp.longitude, dp.time_zone_id, op.longitude, op.time_zone_id, op.address_line1, op.postal_code, op.region, op.country, op.city, op.latitude, op.state, op.id, op.address_line2, op.location_name, op.discriminator, op.port_code
3. 0.001 11.554 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.70..2,922.31 rows=71 width=1,520) (actual time=11.554..11.554 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number, cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock, s.name, s.created_at, s.id, s.length, s.width, s.location_id, s.site_key, s.version, s.ship_type, s.discriminator, s.mmsi, s.call_sign, sp.latitude, sp.region, sp.country, sp.address_line1, sp.state, sp.id, sp.address_line2, sp.location_name, sp.postal_code, sp.discriminator, sp.port_code, sp.longitude, sp.city, sp.time_zone_id, ss.local_clock, ss.version, ss.location_id, ss.site_id, ss.lat, ss.names, ss.eta, ss.remote_clock, ss.lon, ss.discriminator, ss.draught, ss.last_time, ss.first_time, ss.id, ssp.latitude, ssp.address_line1, ssp.country, ssp.address_line2, ssp.state, ssp.longitude, ssp.region, ssp.id, ssp.port_code, ssp.location_name, ssp.city, ssp.discriminator, ssp.postal_code, ssp.time_zone_id, dp.postal_code, dp.address_line2, dp.location_name, dp.id, dp.discriminator, dp.region, dp.country, dp.state, dp.port_code, dp.address_line1, dp.latitude, dp.city, dp.longitude, dp.time_zone_id
4. 0.000 11.553 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.27..2,870.43 rows=71 width=1,254) (actual time=11.553..11.553 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number, cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock, s.name, s.created_at, s.id, s.length, s.width, s.location_id, s.site_key, s.version, s.ship_type, s.discriminator, s.mmsi, s.call_sign, sp.latitude, sp.region, sp.country, sp.address_line1, sp.state, sp.id, sp.address_line2, sp.location_name, sp.postal_code, sp.discriminator, sp.port_code, sp.longitude, sp.city, sp.time_zone_id, ss.local_clock, ss.version, ss.location_id, ss.site_id, ss.lat, ss.names, ss.eta, ss.remote_clock, ss.lon, ss.discriminator, ss.draught, ss.last_time, ss.first_time, ss.id, dp.postal_code, dp.address_line2, dp.location_name, dp.id, dp.discriminator, dp.region, dp.country, dp.state, dp.port_code, dp.address_line1, dp.latitude, dp.city, dp.longitude, dp.time_zone_id
  • Join Filter: ((COALESCE(sn.start_time, sn.created_at) <= ss.first_time) AND (ss.first_time <= COALESCE((sn.deleted_at)::timestamp with time zone, now())))
5. 0.000 11.553 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.84..2,694.49 rows=1 width=1,097) (actual time=11.553..11.553 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number, cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock, s.name, s.created_at, s.id, s.length, s.width, s.location_id, s.site_key, s.version, s.ship_type, s.discriminator, s.mmsi, s.call_sign, sp.latitude, sp.region, sp.country, sp.address_line1, sp.state, sp.id, sp.address_line2, sp.location_name, sp.postal_code, sp.discriminator, sp.port_code, sp.longitude, sp.city, sp.time_zone_id, dp.postal_code, dp.address_line2, dp.location_name, dp.id, dp.discriminator, dp.region, dp.country, dp.state, dp.port_code, dp.address_line1, dp.latitude, dp.city, dp.longitude, dp.time_zone_id
6. 0.003 11.554 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.42..2,686.03 rows=1 width=831) (actual time=11.553..11.554 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number, cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock, s.name, s.created_at, s.id, s.length, s.width, s.location_id, s.site_key, s.version, s.ship_type, s.discriminator, s.mmsi, s.call_sign, sp.latitude, sp.region, sp.country, sp.address_line1, sp.state, sp.id, sp.address_line2, sp.location_name, sp.postal_code, sp.discriminator, sp.port_code, sp.longitude, sp.city, sp.time_zone_id
7. 0.000 11.551 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.99..2,677.87 rows=1 width=565) (actual time=11.551..11.551 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number, cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock, s.name, s.created_at, s.id, s.length, s.width, s.location_id, s.site_key, s.version, s.ship_type, s.discriminator, s.mmsi, s.call_sign
8. 0.000 11.551 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.71..2,677.56 rows=1 width=465) (actual time=11.551..11.551 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number, cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock
  • Join Filter: ((COALESCE(sn.start_time, sn.created_at) <= cs.first_time) AND (cs.first_time <= COALESCE((sn.deleted_at)::timestamp with time zone, now())))
9. 0.001 11.551 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.29..2,675.72 rows=1 width=237) (actual time=11.551..11.551 rows=0 loops=1)

  • Output: sn.trackable_id, sn.version, sn.bill_of_lading, sn.master_leg_id, sn.deleted_at, sn.id, sn.origin_port_id, sn.master_shipment_id, sn.discriminator, sn.inactive_clock, sn.deleted_by, sn.tenant_id, sn.destination_port_id, sn.active_clock, sn.loading_port_id, sn.created_at, sn.created_by, sn.start_time, c.created_at, c.id, c.container_number
  • Join Filter: ((sn.discriminator)::text = 'container'::text)
10. 11.550 11.550 ↓ 0.0 0 1

Seq Scan on public.tracking_session sn (cost=0.00..2,667.40 rows=1 width=201) (actual time=11.550..11.550 rows=0 loops=1)

  • Output: sn.id, sn.discriminator, sn.version, sn.active_clock, sn.inactive_clock, sn.master_leg_id, sn.master_shipment_id, sn.trackable_id, sn.tenant_id, sn.created_by, sn.created_at, sn.deleted_by, sn.deleted_at, sn.bill_of_lading, sn.destination_port_id, sn.loading_port_id, sn.origin_port_id, sn.start_time
  • Filter: (sn.master_shipment_id = '2536afe8-2af2-4904-a3e2-ad15306fe897'::uuid)
  • Rows Removed by Filter: 64034
11. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_container on public.container c (cost=0.29..8.30 rows=1 width=36) (never executed)

  • Output: c.created_at, c.id, c.container_number
  • Index Cond: (sn.trackable_id = c.id)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using container_status_container_id_first_time_ix on public.container_status cs (cost=0.42..1.66 rows=9 width=228) (never executed)

  • Output: cs.line_description, cs.version, cs.site_id, cs.container_id, cs.last_free_day, cs.carrier_identifier, cs.customs_description, cs.id, cs.remote_clock, cs.last_time, cs.other_description, cs.bill_of_lading, cs.demurrage, cs.first_time, cs.names, cs.local_clock
  • Index Cond: (cs.container_id = c.id)
13. 0.000 0.000 ↓ 0.0 0

Index Scan using site_pkey on public.site s (cost=0.28..0.30 rows=1 width=100) (never executed)

  • Output: s.name, s.created_at, s.id, s.length, s.width, s.location_id, s.site_key, s.version, s.ship_type, s.discriminator, s.mmsi, s.call_sign
  • Index Cond: (s.id = cs.site_id)
14. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_location on public.location sp (cost=0.43..8.15 rows=1 width=266) (never executed)

  • Output: sp.latitude, sp.region, sp.country, sp.address_line1, sp.state, sp.id, sp.address_line2, sp.location_name, sp.postal_code, sp.discriminator, sp.port_code, sp.longitude, sp.city, sp.time_zone_id
  • Index Cond: (s.location_id = sp.id)
15. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_location on public.location dp (cost=0.43..8.45 rows=1 width=266) (never executed)

  • Output: dp.postal_code, dp.address_line2, dp.location_name, dp.id, dp.discriminator, dp.region, dp.country, dp.state, dp.port_code, dp.address_line1, dp.latitude, dp.city, dp.longitude, dp.time_zone_id
  • Index Cond: (sn.destination_port_id = dp.id)
16. 0.000 0.000 ↓ 0.0 0

Index Scan using site_status_site_id_first_time_ix on public.site_status ss (cost=0.43..146.15 rows=1,490 width=157) (never executed)

  • Output: ss.local_clock, ss.version, ss.location_id, ss.site_id, ss.lat, ss.names, ss.eta, ss.remote_clock, ss.lon, ss.discriminator, ss.draught, ss.last_time, ss.first_time, ss.id
  • Index Cond: (ss.site_id = s.id)
17. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_location on public.location ssp (cost=0.43..0.72 rows=1 width=266) (never executed)

  • Output: ssp.latitude, ssp.address_line1, ssp.country, ssp.address_line2, ssp.state, ssp.longitude, ssp.region, ssp.id, ssp.port_code, ssp.location_name, ssp.city, ssp.discriminator, ssp.postal_code, ssp.time_zone_id
  • Index Cond: (ss.location_id = ssp.id)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_location on public.location op (cost=0.43..8.45 rows=1 width=266) (never executed)

  • Output: op.longitude, op.time_zone_id, op.address_line1, op.postal_code, op.region, op.country, op.city, op.latitude, op.state, op.id, op.address_line2, op.location_name, op.discriminator, op.port_code
  • Index Cond: (sn.origin_port_id = op.id)
19. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_location on public.location lp (cost=0.43..8.45 rows=1 width=266) (never executed)

  • Output: lp.time_zone_id, lp.port_code, lp.id, lp.address_line1, lp.longitude, lp.city, lp.latitude, lp.state, lp.postal_code, lp.country, lp.address_line2, lp.location_name, lp.discriminator, lp.region
  • Index Cond: (sn.loading_port_id = lp.id)
Planning time : 2.829 ms
Execution time : 11.977 ms