explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MefN

Settings
# exclusive inclusive rows x rows loops node
1. 3,516.406 24,126.317 ↓ 1.0 571,036 1

Sort (cost=3,032,069.76..3,033,493.64 rows=569,552 width=3,400) (actual time=23,501.623..24,126.317 rows=571,036 loops=1)

  • Sort Key: ride_complete_report.appointment_fk, rs.id
  • Sort Method: external merge Disk: 251864kB
2.          

CTE dynamite_claims

3. 1.529 32.601 ↑ 1.3 1,974 1

Hash Join (cost=74.38..1,388.10 rows=2,603 width=82) (actual time=1.823..32.601 rows=1,974 loops=1)

  • Hash Cond: (dynamite_claims_1.claims_adjuster_id = dynamite_claims_adjuster.id)
4. 14.687 29.675 ↓ 1.3 3,318 1

Hash Join (cost=2.73..1,309.63 rows=2,603 width=59) (actual time=0.408..29.675 rows=3,318 loops=1)

  • Hash Cond: (dynamite_claims_1.payer_id = org_payers.id)
5. 14.898 14.898 ↓ 1.0 64,122 1

Seq Scan on dynamite_claims dynamite_claims_1 (cost=0.00..1,138.20 rows=64,120 width=38) (actual time=0.013..14.898 rows=64,122 loops=1)

6. 0.047 0.090 ↑ 1.0 77 1

Hash (cost=1.77..1.77 rows=77 width=29) (actual time=0.089..0.090 rows=77 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
7. 0.043 0.043 ↑ 1.0 77 1

Seq Scan on org_payers (cost=0.00..1.77 rows=77 width=29) (actual time=0.008..0.043 rows=77 loops=1)

8. 0.736 1.397 ↓ 1.0 2,164 1

Hash (cost=44.62..44.62 rows=2,162 width=31) (actual time=1.397..1.397 rows=2,164 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 172kB
9. 0.661 0.661 ↓ 1.0 2,164 1

Seq Scan on dynamite_claims_adjuster (cost=0.00..44.62 rows=2,162 width=31) (actual time=0.005..0.661 rows=2,164 loops=1)

10. 8,499.872 20,609.911 ↓ 1.0 571,036 1

Hash Right Join (cost=392,364.51..476,656.50 rows=569,552 width=3,400) (actual time=12,079.940..20,609.911 rows=571,036 loops=1)

  • Hash Cond: (dynamite_claims.id = appointments.dynamite_claims_id)
11. 34.571 34.571 ↑ 1.3 1,974 1

CTE Scan on dynamite_claims (cost=0.00..52.06 rows=2,603 width=2,604) (actual time=1.829..34.571 rows=1,974 loops=1)

12. 806.604 12,075.468 ↓ 1.0 571,036 1

Hash (cost=334,074.11..334,074.11 rows=569,552 width=710) (actual time=12,075.467..12,075.468 rows=571,036 loops=1)

  • Buckets: 8192 (originally 8192) Batches: 256 (originally 128) Memory Usage: 247913kB
13. 461.998 11,268.864 ↓ 1.0 571,036 1

Gather (cost=109,500.40..334,074.11 rows=569,552 width=710) (actual time=9,667.447..11,268.864 rows=571,036 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
14. 344.037 10,806.866 ↑ 1.2 190,345 3 / 3

Hash Left Join (cost=108,500.40..276,118.91 rows=237,313 width=710) (actual time=9,658.281..10,806.866 rows=190,345 loops=3)

  • Hash Cond: (organisations.market_segment_id = market_segments.id)
15. 334.225 10,462.314 ↑ 1.2 190,345 3 / 3

Hash Join (cost=108,483.18..275,472.94 rows=237,313 width=696) (actual time=9,657.750..10,462.314 rows=190,345 loops=3)

  • Hash Cond: (ride_complete_report.org_fk = organisations.id)
16. 1,614.236 10,110.067 ↑ 1.2 194,979 3 / 3

Parallel Hash Join (cost=108,185.32..274,534.79 rows=243,723 width=613) (actual time=9,639.610..10,110.067 rows=194,979 loops=3)

  • Hash Cond: (rs.id = ride_complete_report.ride_details_fk)
17. 2,262.493 3,869.503 ↑ 1.3 201,394 3 / 3

Parallel Hash Left Join (cost=10,277.24..139,194.01 rows=251,783 width=460) (actual time=2,904.177..3,869.503 rows=201,394 loops=3)

  • Hash Cond: (rs.patient_id = patients.id)
18. 1,404.709 1,404.709 ↑ 1.3 201,394 3 / 3

Parallel Seq Scan on ride_details rs (cost=0.00..100,132.83 rows=251,783 width=416) (actual time=0.011..1,404.709 rows=201,394 loops=3)

19. 94.004 202.301 ↑ 1.2 88,050 3 / 3

Parallel Hash (cost=7,826.55..7,826.55 rows=110,055 width=56) (actual time=202.301..202.301 rows=88,050 loops=3)

  • Buckets: 65536 Batches: 8 Memory Usage: 3552kB
20. 108.297 108.297 ↑ 1.2 88,050 3 / 3

Parallel Seq Scan on patients (cost=0.00..7,826.55 rows=110,055 width=56) (actual time=0.009..108.297 rows=88,050 loops=3)

21. 318.659 4,626.328 ↑ 1.2 194,979 3 / 3

Parallel Hash (cost=89,386.55..89,386.55 rows=243,723 width=153) (actual time=4,626.328..4,626.328 rows=194,979 loops=3)

  • Buckets: 32768 Batches: 32 Memory Usage: 2368kB
22. 648.493 4,307.669 ↑ 1.2 194,979 3 / 3

Parallel Hash Join (cost=65,082.97..89,386.55 rows=243,723 width=153) (actual time=3,987.557..4,307.669 rows=194,979 loops=3)

  • Hash Cond: (ride_complete_report.appointment_fk = appointments.id)
23. 921.523 3,177.634 ↑ 1.2 194,979 3 / 3

Parallel Hash Left Join (cost=31,323.99..47,962.78 rows=243,723 width=40) (actual time=2,804.976..3,177.634 rows=194,979 loops=3)

  • Hash Cond: (ride_complete_report.appointment_fk = invoices.appt_id)
24. 1,241.260 1,934.301 ↑ 1.2 194,979 3 / 3

Parallel Hash Join (cost=21,227.08..33,347.08 rows=243,723 width=24) (actual time=906.337..1,934.301 rows=194,979 loops=3)

  • Hash Cond: (ride_complete_report.receipts_fk = receipts.id)
25. 159.229 159.229 ↑ 1.2 194,979 3 / 3

Parallel Seq Scan on ride_complete_report (cost=0.00..7,904.23 rows=243,723 width=16) (actual time=0.009..159.229 rows=194,979 loops=3)

26. 208.035 533.812 ↑ 1.3 195,558 3 / 3

Parallel Hash (cost=16,976.92..16,976.92 rows=244,492 width=16) (actual time=533.812..533.812 rows=195,558 loops=3)

  • Buckets: 131072 Batches: 16 Memory Usage: 2784kB
27. 325.777 325.777 ↑ 1.3 195,558 3 / 3

Parallel Seq Scan on receipts (cost=0.00..16,976.92 rows=244,492 width=16) (actual time=0.009..325.777 rows=195,558 loops=3)

28. 172.510 321.810 ↑ 1.2 139,278 3 / 3

Parallel Hash (cost=6,899.85..6,899.85 rows=174,085 width=20) (actual time=321.810..321.810 rows=139,278 loops=3)

  • Buckets: 65536 Batches: 8 Memory Usage: 3424kB
29. 149.300 149.300 ↑ 1.2 139,278 3 / 3

Parallel Seq Scan on invoices (cost=0.00..6,899.85 rows=174,085 width=20) (actual time=0.010..149.300 rows=139,278 loops=3)

30. 190.499 481.542 ↑ 1.3 146,291 3 / 3

Parallel Hash (cost=28,257.88..28,257.88 rows=182,888 width=117) (actual time=481.542..481.542 rows=146,291 loops=3)

  • Buckets: 32768 Batches: 32 Memory Usage: 1248kB
31. 291.043 291.043 ↑ 1.3 146,291 3 / 3

Parallel Seq Scan on appointments (cost=0.00..28,257.88 rows=182,888 width=117) (actual time=0.008..291.043 rows=146,291 loops=3)

32. 6.358 18.022 ↓ 1.0 5,021 3 / 3

Hash (cost=235.16..235.16 rows=5,016 width=91) (actual time=18.021..18.022 rows=5,021 loops=3)

  • Buckets: 8192 Batches: 1 Memory Usage: 642kB
33. 11.664 11.664 ↓ 1.0 5,021 3 / 3

Seq Scan on organisations (cost=0.00..235.16 rows=5,016 width=91) (actual time=0.013..11.664 rows=5,021 loops=3)

34. 0.255 0.515 ↓ 1.0 459 3 / 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 34kB
35. 0.260 0.260 ↓ 1.0 459 3 / 3

Seq Scan on market_segments (cost=0.00..11.54 rows=454 width=22) (actual time=0.015..0.260 rows=459 loops=3)

Planning time : 5.620 ms
Execution time : 24,687.488 ms