explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jeO0

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,002.81..8,916.30 rows=146 width=274) (actual rows= loops=)

  • Join Filter: (shift_brokers.broker_id = fleets.id)
  • Filter: ((fleets.type IS NULL) OR ((fleets.type)::text <> 'Broker'::text) OR (((fleets.type)::text = 'Broker'::text) AND ((shift_brokers.retender_sequence IS NULL) OR (shift_brokers.retender_sequence = 0))))
2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,002.52..8,857.03 rows=177 width=297) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Index Only Scan using customers_pkey on customers (cost=0.28..8.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = 536)
4. 0.000 0.000 ↓ 0.0

Gather (cost=1,002.24..8,846.96 rows=177 width=301) (actual rows= loops=)

  • Workers Planned: 2
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.24..7,829.26 rows=74 width=301) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.96..7,805.45 rows=74 width=309) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.68..7,777.78 rows=90 width=298) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.26..7,718.64 rows=90 width=290) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..7,585.76 rows=174 width=24) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..7,301.52 rows=526 width=8) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on jobs (cost=0.00..4,210.19 rows=122 width=8) (actual rows= loops=)

  • Filter: (customer_id = 536)
12. 0.000 0.000 ↓ 0.0

Index Scan using index_shifts_on_job_id on shifts (cost=0.42..25.26 rows=8 width=8) (actual rows= loops=)

  • Index Cond: (job_id = jobs.id)
13. 0.000 0.000 ↓ 0.0

Index Scan using index_v2_timesheets_on_shift_id on v2_timesheets (cost=0.42..0.53 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (shift_id = shifts.id)
  • Filter: ((id IS NULL) OR ((status)::text = ANY ('{approved,invoiced}'::text[])))
14. 0.000 0.000 ↓ 0.0

Index Scan using index_v2_customer_transactions_on_v2_timesheet_id on v2_customer_transactions (cost=0.42..0.75 rows=1 width=274) (actual rows= loops=)

  • Index Cond: (v2_timesheet_id = v2_timesheets.id)
  • Filter: ((NOT exported) AND (created_at >= '2019-01-01 00:00:00'::timestamp without time zone) AND (((type)::text = 'V2::AdjustmentTransaction'::text) OR (price_per_unit_cents = 0)))
15. 0.000 0.000 ↓ 0.0

Index Scan using v2_earnings_pkey on v2_earnings (cost=0.42..0.66 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = v2_customer_transactions.v2_earning_id)
  • Filter: ((fleet_approval_status <> 0) OR (fleet_approval_status IS NULL))
16. 0.000 0.000 ↓ 0.0

Index Scan using fleets_pkey on fleets (cost=0.28..0.31 rows=1 width=19) (actual rows= loops=)

  • Index Cond: (id = v2_earnings.fleet_id)
  • Filter: ((type IS NULL) OR ((type)::text <> 'Broker'::text) OR ((type)::text = 'Broker'::text))
17. 0.000 0.000 ↓ 0.0

Index Only Scan using job_sites_pkey on job_sites (cost=0.29..0.32 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = v2_timesheets.job_site_id)
18. 0.000 0.000 ↓ 0.0

Index Scan using index_shift_brokers_on_shift_id on shift_brokers (cost=0.29..0.31 rows=1 width=20) (actual rows= loops=)

  • Index Cond: (shift_id = shifts.id)