explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3iyj

Settings
# exclusive inclusive rows x rows loops node
1. 71.661 151.492 ↓ 2.2 1,932 1

Gather Merge (cost=9,457.41..9,557.99 rows=862 width=286) (actual time=148.847..151.492 rows=1,932 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 0.928 79.831 ↓ 1.5 644 3 / 3

Sort (cost=8,457.39..8,458.47 rows=431 width=286) (actual time=79.770..79.831 rows=644 loops=3)

  • Sort Key: shifts.starts_at, shifts.id
  • Sort Method: quicksort Memory: 232kB
  • Worker 0: Sort Method: quicksort Memory: 154kB
  • Worker 1: Sort Method: quicksort Memory: 204kB
3. 1.177 78.903 ↓ 1.5 644 3 / 3

Nested Loop (cost=1.26..8,438.53 rows=431 width=286) (actual time=2.254..78.903 rows=644 loops=3)

4. 1.770 75.813 ↓ 1.7 638 3 / 3

Nested Loop (cost=0.84..8,200.65 rows=386 width=20) (actual time=2.236..75.813 rows=638 loops=3)

5. 0.334 36.935 ↓ 2.3 1,484 3 / 3

Nested Loop (cost=0.42..7,857.10 rows=639 width=12) (actual time=2.078..36.935 rows=1,484 loops=3)

6. 34.513 34.513 ↑ 1.3 116 3 / 3

Parallel Seq Scan on jobs (cost=0.00..4,187.78 rows=148 width=4) (actual time=2.054..34.513 rows=116 loops=3)

  • Filter: (customer_id = 563)
  • Rows Removed by Filter: 16,754
7. 2.088 2.088 ↓ 1.6 13 348 / 3

Index Scan using index_shifts_on_job_id on shifts (cost=0.42..24.71 rows=8 width=16) (actual time=0.007..0.018 rows=13 loops=348)

  • Index Cond: (job_id = jobs.id)
8. 37.108 37.108 ↓ 0.0 0 4,453 / 3

Index Scan using index_v2_timesheets_on_shift_id on v2_timesheets (cost=0.42..0.53 rows=1 width=16) (actual time=0.025..0.025 rows=0 loops=4,453)

  • Index Cond: (shift_id = shifts.id)
9. 1.913 1.913 ↑ 1.0 1 1,913 / 3

Index Scan using index_v2_customer_transactions_on_v2_timesheet_id on v2_customer_transactions (cost=0.42..0.61 rows=1 width=274) (actual time=0.003..0.003 rows=1 loops=1,913)

  • Index Cond: (v2_timesheet_id = v2_timesheets.id)
Planning time : 1.079 ms
Execution time : 151.901 ms