explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vcyg

Settings
# exclusive inclusive rows x rows loops node
1. 0.473 65.132 ↓ 1.8 262 1

Nested Loop Left Join (cost=1,002.81..8,916.09 rows=146 width=274) (actual time=2.005..65.132 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 64.135 ↓ 1.5 262 1

Nested Loop (cost=1,002.52..8,856.82 rows=177 width=297) (actual time=1.988..64.135 rows=262 loops=1)

3. 0.020 0.020 ↑ 1.0 1 1

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

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

Gather (cost=1,002.24..8,846.75 rows=177 width=301) (actual time=1.973..65.453 rows=262 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.142 35.013 ↓ 1.2 87 3 / 3

Nested Loop (cost=2.24..7,829.05 rows=74 width=301) (actual time=2.910..35.013 rows=87 loops=3)

6. 0.113 34.696 ↓ 1.2 87 3 / 3

Nested Loop (cost=1.96..7,805.24 rows=74 width=309) (actual time=2.889..34.696 rows=87 loops=3)

7. 0.112 34.321 ↑ 1.0 87 3 / 3

Nested Loop (cost=1.68..7,777.57 rows=90 width=298) (actual time=2.861..34.321 rows=87 loops=3)

8. 0.071 33.860 ↑ 1.0 87 3 / 3

Nested Loop (cost=1.26..7,718.65 rows=90 width=290) (actual time=2.840..33.860 rows=87 loops=3)

9. 0.289 33.352 ↑ 2.0 87 3 / 3

Nested Loop (cost=0.84..7,585.81 rows=174 width=24) (actual time=2.819..33.352 rows=87 loops=3)

10. 0.218 30.937 ↓ 1.3 709 3 / 3

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

11. 29.739 29.739 ↑ 1.2 98 3 / 3

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

  • Filter: (customer_id = 536)
  • Rows Removed by Filter: 16,783
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.65 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=262)

  • Index Cond: (id = v2_customer_transactions.v2_earning_id)
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 : 10.378 ms
Execution time : 66.856 ms