explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cphf

Settings
# exclusive inclusive rows x rows loops node
1. 23.539 457.366 ↑ 5.5 723 1

Gather Merge (cost=81,732.88..82,193.75 rows=3,950 width=1,202) (actual time=445.813..457.366 rows=723 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 2.253 433.827 ↑ 8.2 241 3 / 3

Sort (cost=80,732.86..80,737.80 rows=1,975 width=1,202) (actual time=433.753..433.827 rows=241 loops=3)

  • Sort Key: rs.appt_id, rs.id
  • Sort Method: quicksort Memory: 157kB
  • Worker 0: Sort Method: quicksort Memory: 129kB
  • Worker 1: Sort Method: quicksort Memory: 166kB
3. 6.741 431.574 ↑ 8.2 241 3 / 3

Hash Left Join (cost=11,056.31..80,624.75 rows=1,975 width=1,202) (actual time=326.839..431.574 rows=241 loops=3)

  • Hash Cond: (dynamite_claims.payer_id = org_payers.id)
4. 0.332 424.728 ↑ 8.2 241 3 / 3

Hash Left Join (cost=11,053.58..80,241.57 rows=1,975 width=839) (actual time=326.262..424.728 rows=241 loops=3)

  • Hash Cond: (dynamite_claims.claims_adjuster_id = dynamite_claims_adjuster.id)
5. 0.345 418.613 ↑ 8.2 241 3 / 3

Nested Loop Left Join (cost=10,959.47..80,142.28 rows=1,975 width=816) (actual time=320.453..418.613 rows=241 loops=3)

6. 0.553 418.027 ↑ 8.2 241 3 / 3

Hash Left Join (cost=10,959.18..79,476.52 rows=1,975 width=786) (actual time=320.440..418.027 rows=241 loops=3)

  • Hash Cond: (organisations.market_segment_id = market_segments.id)
7. 0.388 416.977 ↑ 8.2 241 3 / 3

Hash Left Join (cost=10,941.97..79,454.07 rows=1,975 width=772) (actual time=319.924..416.977 rows=241 loops=3)

  • Hash Cond: (rs.org_id = organisations.id)
8. 0.470 416.567 ↑ 8.2 241 3 / 3

Nested Loop (cost=10,933.65..79,418.61 rows=1,975 width=689) (actual time=319.884..416.567 rows=241 loops=3)

9. 0.719 415.344 ↑ 7.9 251 3 / 3

Nested Loop (cost=10,933.37..78,530.70 rows=1,975 width=693) (actual time=319.852..415.344 rows=251 loops=3)

10. 0.591 413.872 ↑ 7.9 251 3 / 3

Nested Loop (cost=10,932.94..74,535.61 rows=1,975 width=645) (actual time=319.836..413.872 rows=251 loops=3)

11. 16.578 410.265 ↑ 7.9 251 3 / 3

Nested Loop (cost=10,932.52..68,164.60 rows=1,986 width=553) (actual time=319.816..410.265 rows=251 loops=3)

  • Join Filter: (rs.appt_id = appointments.id)
12. 65.218 361.055 ↑ 1.2 6,526 3 / 3

Parallel Hash Join (cost=10,932.10..62,280.65 rows=8,056 width=444) (actual time=319.701..361.055 rows=6,526 loops=3)

  • Hash Cond: (rs.appt_id = invoices.appt_id)
13. 30.025 30.573 ↑ 1.2 6,550 3 / 3

Parallel Bitmap Heap Scan on ride_details rs (cost=493.41..49,896.81 rows=8,058 width=424) (actual time=1.797..30.573 rows=6,550 loops=3)

  • Recheck Cond: (org_id = 1,153)
  • Filter: ((NOT is_pr_ride) AND ((ride_category)::text = 'completed'::text))
  • Rows Removed by Filter: 7
  • Heap Blocks: exact=3,795
14. 0.548 0.548 ↑ 1.0 19,670 1 / 3

Bitmap Index Scan on idx_ride_organisationid (cost=0.00..488.57 rows=19,753 width=0) (actual time=1.643..1.643 rows=19,670 loops=1)

  • Index Cond: (org_id = 1,153)
15. 143.301 265.264 ↑ 1.3 139,241 3 / 3

Parallel Hash (cost=7,174.64..7,174.64 rows=177,764 width=20) (actual time=265.264..265.264 rows=139,241 loops=3)

  • Buckets: 65,536 Batches: 8 Memory Usage: 3,424kB
16. 121.963 121.963 ↑ 1.3 139,241 3 / 3

Parallel Seq Scan on invoices (cost=0.00..7,174.64 rows=177,764 width=20) (actual time=0.007..121.963 rows=139,241 loops=3)

17. 32.632 32.632 ↓ 0.0 0 19,579 / 3

Index Scan using appt_id_idx on appointments (cost=0.42..0.72 rows=1 width=117) (actual time=0.005..0.005 rows=0 loops=19,579)

  • Index Cond: (id = invoices.appt_id)
  • Filter: (invoice_generated AND (invoice_generation_time >= 1,546,300,800) AND (invoice_generation_time <= 1,567,727,999))
  • Rows Removed by Filter: 1
18. 3.016 3.016 ↑ 1.0 1 754 / 3

Index Scan using unique_ride on receipts (cost=0.42..3.21 rows=1 width=96) (actual time=0.012..0.012 rows=1 loops=754)

  • Index Cond: (ride_detail_id = rs.id)
19. 0.753 0.753 ↑ 1.0 1 753 / 3

Index Scan using patients_pkey on patients (cost=0.42..2.02 rows=1 width=56) (actual time=0.003..0.003 rows=1 loops=753)

  • Index Cond: (id = rs.patient_id)
20. 0.753 0.753 ↑ 1.0 1 753 / 3

Index Only Scan using users_pkey on users (cost=0.29..0.45 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=753)

  • Index Cond: (id = rs.ride_requester_id)
  • Heap Fetches: 723
21. 0.008 0.022 ↑ 1.0 1 3 / 3

Hash (cost=8.30..8.30 rows=1 width=91) (actual time=0.021..0.022 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
22. 0.014 0.014 ↑ 1.0 1 3 / 3

Index Scan using organisations_pkey on organisations (cost=0.28..8.30 rows=1 width=91) (actual time=0.013..0.014 rows=1 loops=3)

  • Index Cond: (id = 1,153)
23. 0.250 0.497 ↑ 1.0 454 3 / 3

Hash (cost=11.54..11.54 rows=454 width=22) (actual time=0.496..0.497 rows=454 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 33kB
24. 0.247 0.247 ↑ 1.0 454 3 / 3

Seq Scan on market_segments (cost=0.00..11.54 rows=454 width=22) (actual time=0.011..0.247 rows=454 loops=3)

25. 0.241 0.241 ↓ 0.0 0 723 / 3

Index Scan using dynamite_claims_pkey on dynamite_claims (cost=0.29..0.34 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=723)

  • Index Cond: (appointments.dynamite_claims_id = id)
26. 2.917 5.783 ↓ 1.0 2,162 3 / 3

Hash (cost=67.38..67.38 rows=2,138 width=31) (actual time=5.783..5.783 rows=2,162 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 172kB
27. 2.866 2.866 ↓ 1.0 2,162 3 / 3

Seq Scan on dynamite_claims_adjuster (cost=0.00..67.38 rows=2,138 width=31) (actual time=0.011..2.866 rows=2,162 loops=3)

28. 0.052 0.105 ↑ 1.0 77 3 / 3

Hash (cost=1.77..1.77 rows=77 width=29) (actual time=0.104..0.105 rows=77 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
29. 0.053 0.053 ↑ 1.0 77 3 / 3

Seq Scan on org_payers (cost=0.00..1.77 rows=77 width=29) (actual time=0.015..0.053 rows=77 loops=3)

Planning time : 8.654 ms
Execution time : 458.175 ms