explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1JVA

Settings
# exclusive inclusive rows x rows loops node
1. 0.522 61.369 ↓ 1.8 262 1

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

  • 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 60.323 ↓ 1.5 262 1

Nested Loop (cost=1,002.52..8,857.02 rows=177 width=297) (actual time=1.966..60.323 rows=262 loops=1)

3. 0.013 0.013 ↑ 1.0 1 1

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

  • Index Cond: (id = 536)
  • Heap Fetches: 2
4. 27.879 61.764 ↓ 1.5 262 1

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

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.155 33.885 ↓ 1.2 87 3 / 3

Nested Loop (cost=2.24..7,829.26 rows=74 width=301) (actual time=3.071..33.885 rows=87 loops=3)

6. 0.148 33.555 ↓ 1.2 87 3 / 3

Nested Loop (cost=1.96..7,805.44 rows=74 width=309) (actual time=3.049..33.555 rows=87 loops=3)

7. 0.152 33.145 ↑ 1.0 87 3 / 3

Nested Loop (cost=1.68..7,777.78 rows=90 width=298) (actual time=3.007..33.145 rows=87 loops=3)

8. 0.100 32.644 ↑ 1.0 87 3 / 3

Nested Loop (cost=1.26..7,718.64 rows=90 width=290) (actual time=2.984..32.644 rows=87 loops=3)

9. 0.454 32.107 ↑ 2.0 87 3 / 3

Nested Loop (cost=0.84..7,585.78 rows=174 width=24) (actual time=2.967..32.107 rows=87 loops=3)

10. 0.268 29.527 ↓ 1.3 709 3 / 3

Nested Loop (cost=0.42..7,301.52 rows=526 width=8) (actual time=2.309..29.527 rows=709 loops=3)

11. 28.279 28.279 ↑ 1.2 98 3 / 3

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

  • Filter: (customer_id = 536)
  • Rows Removed by Filter: 16,781
12. 0.980 0.980 ↑ 1.1 7 294 / 3

Index Scan using index_shifts_on_job_id on shifts (cost=0.42..25.26 rows=8 width=8) (actual time=0.005..0.010 rows=7 loops=294)

  • Index Cond: (job_id = jobs.id)
13. 2.126 2.126 ↓ 0.0 0 2,126 / 3

Index Scan using index_v2_timesheets_on_shift_id on v2_timesheets (cost=0.42..0.53 rows=1 width=24) (actual time=0.003..0.003 rows=0 loops=2,126)

  • Index Cond: (shift_id = shifts.id)
  • Filter: ((id IS NULL) OR ((status)::text = ANY ('{approved,invoiced}'::text[])))
  • Rows Removed by Filter: 0
14. 0.437 0.437 ↑ 1.0 1 262 / 3

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 time=0.004..0.005 rows=1 loops=262)

  • 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)))
  • Rows Removed by Filter: 0
15. 0.349 0.349 ↑ 1.0 1 262 / 3

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

  • Index Cond: (id = v2_customer_transactions.v2_earning_id)
  • Filter: ((fleet_approval_status <> 0) OR (fleet_approval_status IS NULL))
16. 0.262 0.262 ↑ 1.0 1 262 / 3

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

  • Index Cond: (id = v2_earnings.fleet_id)
  • Filter: ((type IS NULL) OR ((type)::text <> 'Broker'::text) OR ((type)::text = 'Broker'::text))
17. 0.175 0.175 ↑ 1.0 1 262 / 3

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

  • Index Cond: (id = v2_timesheets.job_site_id)
  • Heap Fetches: 262
18. 0.524 0.524 ↓ 0.0 0 262

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

  • Index Cond: (shift_id = shifts.id)
Planning time : 8.922 ms
Execution time : 63.138 ms