explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kWZr : with 'not_disputed'

Settings
# exclusive inclusive rows x rows loops node
1. 0.406 72.907 ↓ 1.8 262 1

Nested Loop Left Join (cost=1,002.81..8,916.32 rows=146 width=274) (actual time=2.631..72.907 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 71.977 ↓ 1.5 262 1

Nested Loop (cost=1,002.52..8,857.04 rows=177 width=297) (actual time=2.613..71.977 rows=262 loops=1)

3. 0.019 0.019 ↑ 1.0 1 1

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

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

Gather (cost=1,002.24..8,846.98 rows=177 width=301) (actual time=2.597..73.475 rows=262 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.176 40.361 ↓ 1.2 87 3 / 3

Nested Loop (cost=2.24..7,829.28 rows=74 width=301) (actual time=3.688..40.361 rows=87 loops=3)

6. 0.156 40.010 ↓ 1.2 87 3 / 3

Nested Loop (cost=1.96..7,805.46 rows=74 width=309) (actual time=3.664..40.010 rows=87 loops=3)

7. 0.092 39.592 ↑ 1.0 87 3 / 3

Nested Loop (cost=1.68..7,777.80 rows=90 width=298) (actual time=3.627..39.592 rows=87 loops=3)

8. 0.435 39.063 ↑ 1.0 87 3 / 3

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

9. 0.684 38.104 ↑ 2.0 87 3 / 3

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

10. 0.272 35.294 ↓ 1.3 709 3 / 3

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

11. 33.846 33.846 ↑ 1.2 98 3 / 3

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

  • Filter: (customer_id = 536)
  • Rows Removed by Filter: 16,783
12. 1.176 1.176 ↑ 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.007..0.012 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.524 0.524 ↑ 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.005..0.006 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.437 0.437 ↑ 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.005..0.005 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 : 7.333 ms
Execution time : 74.802 ms