explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HmVY

Settings
# exclusive inclusive rows x rows loops node
1. 6.353 43.289 ↓ 73.6 5,224 1

Nested Loop Left Join (cost=3.56..4,283.36 rows=71 width=2,052) (actual time=1.372..43.289 rows=5,224 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. 6.190 36.936 ↓ 73.6 5,224 1

Nested Loop Left Join (cost=3.13..3,682.87 rows=71 width=1,786) (actual time=1.371..36.936 rows=5,224 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. 6.199 30.746 ↓ 73.6 5,224 1

Nested Loop Left Join (cost=2.70..3,082.39 rows=71 width=1,520) (actual time=1.369..30.746 rows=5,224 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. 4.233 24.547 ↓ 73.6 5,224 1

Nested Loop Left Join (cost=2.27..3,030.51 rows=71 width=1,254) (actual time=1.367..24.547 rows=5,224 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.001 14.502 ↓ 2.0 2 1

Nested Loop Left Join (cost=1.84..2,854.56 rows=1 width=1,097) (actual time=1.357..14.502 rows=2 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 14.483 ↓ 2.0 2 1

Nested Loop Left Join (cost=1.42..2,846.11 rows=1 width=831) (actual time=1.343..14.483 rows=2 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.003 14.478 ↓ 2.0 2 1

Nested Loop Left Join (cost=0.99..2,837.95 rows=1 width=565) (actual time=1.341..14.478 rows=2 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.012 14.465 ↓ 2.0 2 1

Nested Loop Left Join (cost=0.71..2,837.64 rows=1 width=465) (actual time=1.333..14.465 rows=2 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())))
  • Rows Removed by Join Filter: 1
9. 0.006 14.444 ↑ 1.0 1 1

Nested Loop (cost=0.29..2,835.80 rows=1 width=237) (actual time=1.318..14.444 rows=1 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
10. 14.432 14.432 ↑ 1.0 1 1

Seq Scan on public.tracking_session sn (cost=0.00..2,827.48 rows=1 width=201) (actual time=1.309..14.432 rows=1 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.discriminator)::text = 'container'::text) AND (sn.master_shipment_id = 'b6451331-5e8a-45cb-9f66-073dd6a27e5c'::uuid))
  • Rows Removed by Filter: 64033
11. 0.006 0.006 ↑ 1.0 1 1

Index Scan using pk_container on public.container c (cost=0.29..8.30 rows=1 width=36) (actual time=0.006..0.006 rows=1 loops=1)

  • Output: c.created_at, c.id, c.container_number
  • Index Cond: (c.id = sn.trackable_id)
12. 0.009 0.009 ↑ 3.0 3 1

Index Scan using container_status_container_id_first_time_ix on public.container_status cs (cost=0.42..1.66 rows=9 width=228) (actual time=0.005..0.009 rows=3 loops=1)

  • 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.010 0.010 ↑ 1.0 1 2

Index Scan using site_pkey on public.site s (cost=0.28..0.30 rows=1 width=100) (actual time=0.005..0.005 rows=1 loops=2)

  • 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.002 0.002 ↓ 0.0 0 2

Index Scan using pk_location on public.location sp (cost=0.43..8.15 rows=1 width=266) (actual time=0.001..0.001 rows=0 loops=2)

  • 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.018 0.018 ↑ 1.0 1 2

Index Scan using pk_location on public.location dp (cost=0.43..8.45 rows=1 width=266) (actual time=0.007..0.009 rows=1 loops=2)

  • 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. 5.812 5.812 ↓ 1.8 2,612 2

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) (actual time=0.005..2.906 rows=2,612 loops=2)

  • 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 5,224

Index Scan using pk_location on public.location ssp (cost=0.43..0.72 rows=1 width=266) (actual time=0.000..0.000 rows=0 loops=5,224)

  • 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 5,224

Index Scan using pk_location on public.location op (cost=0.43..8.45 rows=1 width=266) (actual time=0.000..0.000 rows=0 loops=5,224)

  • 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 5,224

Index Scan using pk_location on public.location lp (cost=0.43..8.45 rows=1 width=266) (actual time=0.000..0.000 rows=0 loops=5,224)

  • 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.926 ms
Execution time : 44.672 ms