explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OQuI

Settings
# exclusive inclusive rows x rows loops node
1. 21.784 426.590 ↑ 5.5 723 1

Gather Merge (cost=81,742.35..82,203.22 rows=3,950 width=1,202) (actual time=415.887..426.590 rows=723 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 0.914 404.806 ↑ 8.2 241 3 / 3

Sort (cost=80,742.33..80,747.26 rows=1,975 width=1,202) (actual time=404.734..404.806 rows=241 loops=3)

  • Sort Key: rs.appt_id, rs.id
  • Sort Method: quicksort Memory: 166kB
  • Worker 0: Sort Method: quicksort Memory: 133kB
  • Worker 1: Sort Method: quicksort Memory: 154kB
3. 7.165 403.892 ↑ 8.2 241 3 / 3

Hash Left Join (cost=11,056.31..80,634.22 rows=1,975 width=1,202) (actual time=307.960..403.892 rows=241 loops=3)

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

Hash Left Join (cost=11,053.58..80,241.17 rows=1,975 width=839) (actual time=307.395..396.625 rows=241 loops=3)

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

Nested Loop Left Join (cost=10,959.47..80,141.88 rows=1,975 width=816) (actual time=303.598..392.527 rows=241 loops=3)

6. 0.347 390.600 ↑ 8.2 241 3 / 3

Hash Left Join (cost=10,959.18..79,476.11 rows=1,975 width=786) (actual time=303.585..390.600 rows=241 loops=3)

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

Hash Left Join (cost=10,941.97..79,453.67 rows=1,975 width=772) (actual time=303.075..389.761 rows=241 loops=3)

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

Nested Loop (cost=10,933.65..79,418.20 rows=1,975 width=689) (actual time=303.039..389.354 rows=241 loops=3)

9. 0.681 388.150 ↑ 7.9 251 3 / 3

Nested Loop (cost=10,933.37..78,530.30 rows=1,975 width=693) (actual time=303.017..388.150 rows=251 loops=3)

10. 0.684 386.716 ↑ 7.9 251 3 / 3

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

11. 10.171 383.770 ↑ 7.9 251 3 / 3

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

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

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

  • Hash Cond: (rs.appt_id = invoices.appt_id)
13. 26.276 26.828 ↑ 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=2.843..26.828 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=1,311
14. 0.552 0.552 ↑ 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.654..1.655 rows=19,670 loops=1)

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

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

  • Buckets: 65,536 Batches: 8 Memory Usage: 3,424kB
16. 119.513 119.513 ↑ 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..119.513 rows=139,241 loops=3)

17. 39.158 39.158 ↓ 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.006..0.006 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. 2.262 2.262 ↑ 1.0 1 754 / 3

Index Scan using unique_ride on receipts (cost=0.42..3.21 rows=1 width=96) (actual time=0.009..0.009 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.021 ↑ 1.0 1 3 / 3

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

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

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

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

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

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

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

25. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=723)

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

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 172kB
27. 1.147 1.147 ↓ 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.012..1.147 rows=2,162 loops=3)

28. 0.053 0.102 ↑ 1.0 77 3 / 3

Hash (cost=1.77..1.77 rows=77 width=29) (actual time=0.101..0.102 rows=77 loops=3)

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

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

Planning time : 8.586 ms
Execution time : 427.542 ms