explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jYMC

Settings
# exclusive inclusive rows x rows loops node
1. 58.976 23,789.410 ↓ 1.1 7,123 1

Nested Loop Left Join (cost=1,974.70..5,105,504.15 rows=6,404 width=1,037) (actual time=54.417..23,789.410 rows=7,123 loops=1)

2. 0.000 60.705 ↓ 1.1 7,123 1

Gather (cost=1,974.56..161,330.21 rows=6,404 width=897) (actual time=49.055..60.705 rows=7,123 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 4.091 558.741 ↑ 1.1 2,374 3 / 3

Hash Left Join (cost=974.56..159,689.81 rows=2,668 width=897) (actual time=56.915..558.741 rows=2,374 loops=3)

  • Hash Cond: (((appointments.additional_details ->> 'requesting_organization'::text))::integer = req_org.id)
4. 4.493 553.468 ↑ 1.1 2,374 3 / 3

Hash Left Join (cost=823.14..159,530.39 rows=2,668 width=867) (actual time=55.710..553.468 rows=2,374 loops=3)

  • Hash Cond: (dynamite_claims.payer_id = org_payers.id)
5. 3.571 547.526 ↑ 1.1 2,374 3 / 3

Hash Left Join (cost=820.41..159,520.62 rows=2,668 width=846) (actual time=54.240..547.526 rows=2,374 loops=3)

  • Hash Cond: (dynamite_claims.claims_adjuster_id = dynamite_claims_adjuster.id)
6. 3.354 541.429 ↑ 1.1 2,374 3 / 3

Hash Left Join (cost=786.23..159,479.43 rows=2,668 width=809) (actual time=51.691..541.429 rows=2,374 loops=3)

  • Hash Cond: (appointments.dynamite_claims_id = dynamite_claims.id)
7. 4.464 497.947 ↑ 1.1 2,374 3 / 3

Nested Loop Left Join (cost=154.65..158,840.86 rows=2,668 width=776) (actual time=11.407..497.947 rows=2,374 loops=3)

8. 4.906 481.611 ↑ 1.1 2,374 3 / 3

Nested Loop Left Join (cost=154.23..148,228.60 rows=2,662 width=760) (actual time=11.373..481.611 rows=2,374 loops=3)

9. 3.525 460.085 ↑ 1.1 2,374 3 / 3

Hash Left Join (cost=153.81..146,946.12 rows=2,662 width=734) (actual time=11.323..460.085 rows=2,374 loops=3)

  • Hash Cond: (organisations.market_segment_id = market_segments.id)
10. 6.390 456.540 ↑ 1.1 2,374 3 / 3

Hash Left Join (cost=152.70..146,932.10 rows=2,662 width=720) (actual time=11.283..456.540 rows=2,374 loops=3)

  • Hash Cond: (ride_details.org_id = organisations.id)
11. 4.738 447.873 ↑ 1.1 2,374 3 / 3

Nested Loop Left Join (cost=1.27..146,773.66 rows=2,662 width=637) (actual time=7.552..447.873 rows=2,374 loops=3)

12. 5.746 428.889 ↑ 1.1 2,374 3 / 3

Nested Loop (cost=0.85..145,486.90 rows=2,662 width=614) (actual time=7.490..428.889 rows=2,374 loops=3)

13. 8.404 408.897 ↑ 1.1 2,374 3 / 3

Nested Loop (cost=0.43..142,867.01 rows=2,673 width=520) (actual time=7.445..408.897 rows=2,374 loops=3)

14. 276.518 276.518 ↑ 1.1 4,959 3 / 3

Parallel Seq Scan on appointments (cost=0.00..63,490.47 rows=5,370 width=114) (actual time=1.843..276.518 rows=4,959 loops=3)

  • Filter: (invoice_generated AND (invoice_generation_time >= 1,577,836,800) AND (invoice_generation_time <= 1,579,132,799))
  • Rows Removed by Filter: 301,057
15. 123.975 123.975 ↓ 0.0 0 14,877 / 3

Index Scan using idx_appt_id_ride_detail on ride_details (cost=0.43..14.77 rows=1 width=410) (actual time=0.023..0.025 rows=0 loops=14,877)

  • Index Cond: (appt_id = appointments.id)
  • Filter: ((NOT is_pr_ride) AND ((ride_category)::text = 'completed'::text) AND (org_id = ANY ('{573,147,148,584,1672,736,149,551,150,620,1808,713,114,231,655,54,567,730,663,676,115,672,232,677,233,67,750,563,675,127,151,641,592,690,600,128,194,195,196,644,656,55,152,234,221,582,350,734,83,720,217,1719,198,709,753,751,154,737,442,362,698,267,235,100,116,268,410,236,586,363,1316,681,237,269,101,199,408,570,238,155,239,56,240,310,241,404,342,69,1724,423,156,635,667,717,649,157,412,638,84,729,555,433,434,652,85,623,117,200,699,590,722,585,587,270,671,308,158,653,602,271,631,390,721,580,413,242,130,613,131,726,550,745,118,243,601,355,356,357,129,659,272,574,102,201,159,614,132,688,1720,103,665,273,629,633,244,99,632,1657,160,274,628,630,66,57,664,714,428,364,365,443,311,366,300,301,399,642,696,612,727,740,566,97,98,609,738,110,728,637,682,405,596,161,202,758,275,625,406,702,245,568,349,747,693,359,748,545,689,544,58,162,163,576,554,133,79,78,218,424,598,589,409,276,164,134,277,278,59,246,669,645,704,739,549,435,577,247,248,599,165,203,279,166,280,431,718,414,135,416,281,707,1699,249,610,697,1819,617,593,1651,204,673,205,634,119,167,749,755,711,719,206,766,168,207,591,208,556,547,250,169,170,171,87,583,686,657,86,251,209,562,579,283,60,284,285,286,756,210,104,757,172,173,252,253,72,679,746,575,288,1745,351,691,558,594,678,425,680,670,626,624,743,88,415,174,105,352,136,643,660,700,175,560,692,254,622,358,68,216,1807,120,754,289,255,581,219,353,177,137,572,426,142,73,111,742,220,211,606,121,604,603,546,256,1760,735,290,71,178,441,651,647,427,391,392,141,724,752,74,1695,674,75,542,354,561,440,212,543,687,1696,432,605,70,715,578,648,213,621,703,588,89,257,214,710,616,639,291,552,61,258,668,287,706,215,292,293,90,259,312,417,140,50,179,378,732,180,62,1562,684,595,565,553,723,138,112,260,705,683,182,646,636,360,685,361,63,418,571,91,64,65,153,564,183,294,1568,261,419,420,421,557,731,654,569,701,262,139,716,662,712,615,708,339,184,627,263,185,186,422,607,264,302,122,92,106,295,666,388,296,107,123,187,265,188,189,266,733,650,618,611,559,548,190}'::integer[])))
  • Rows Removed by Filter: 1
16. 14.246 14.246 ↑ 1.0 1 7,123 / 3

Index Scan using unique_receipts_id on receipts (cost=0.43..0.98 rows=1 width=98) (actual time=0.006..0.006 rows=1 loops=7,123)

  • Index Cond: (ride_detail_id = ride_details.id)
17. 14.246 14.246 ↑ 1.0 1 7,123 / 3

Index Scan using patients_pkey on patients (cost=0.42..0.48 rows=1 width=31) (actual time=0.006..0.006 rows=1 loops=7,123)

  • Index Cond: (ride_details.patient_id = id)
18. 0.719 2.277 ↓ 1.0 954 3 / 3

Hash (cost=139.52..139.52 rows=952 width=87) (actual time=2.276..2.277 rows=954 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 120kB
19. 1.558 1.558 ↓ 1.0 954 3 / 3

Seq Scan on organisations (cost=0.00..139.52 rows=952 width=87) (actual time=0.016..1.558 rows=954 loops=3)

20. 0.007 0.020 ↑ 1.0 5 3 / 3

Hash (cost=1.05..1.05 rows=5 width=22) (actual time=0.020..0.020 rows=5 loops=3)

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

Seq Scan on market_segments (cost=0.00..1.05 rows=5 width=22) (actual time=0.010..0.013 rows=5 loops=3)

22. 16.620 16.620 ↑ 1.0 1 7,123 / 3

Index Scan using users_pkey on users (cost=0.42..0.48 rows=1 width=30) (actual time=0.007..0.007 rows=1 loops=7,123)

  • Index Cond: (ride_details.ride_requester_id = id)
23. 11.872 11.872 ↑ 1.0 1 7,123 / 3

Index Scan using appt_id on invoices (cost=0.42..3.99 rows=1 width=20) (actual time=0.005..0.005 rows=1 loops=7,123)

  • Index Cond: (appt_id = appointments.id)
24. 23.511 40.128 ↑ 1.0 20,111 3 / 3

Hash (cost=376.81..376.81 rows=20,381 width=41) (actual time=40.128..40.128 rows=20,111 loops=3)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,012kB
25. 16.617 16.617 ↑ 1.0 20,111 3 / 3

Seq Scan on dynamite_claims (cost=0.00..376.81 rows=20,381 width=41) (actual time=0.011..16.617 rows=20,111 loops=3)

26. 1.968 2.526 ↑ 1.0 946 3 / 3

Hash (cost=21.86..21.86 rows=986 width=45) (actual time=2.526..2.526 rows=946 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 82kB
27. 0.558 0.558 ↑ 1.0 946 3 / 3

Seq Scan on dynamite_claims_adjuster (cost=0.00..21.86 rows=986 width=45) (actual time=0.018..0.558 rows=946 loops=3)

28. 0.054 1.449 ↑ 1.0 77 3 / 3

Hash (cost=1.77..1.77 rows=77 width=29) (actual time=1.448..1.449 rows=77 loops=3)

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

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

30. 0.588 1.182 ↓ 1.0 954 3 / 3

Hash (cost=139.52..139.52 rows=952 width=34) (actual time=1.181..1.182 rows=954 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 72kB
31. 0.594 0.594 ↓ 1.0 954 3 / 3

Seq Scan on organisations req_org (cost=0.00..139.52 rows=952 width=34) (actual time=0.004..0.594 rows=954 loops=3)

32. 7.123 7.123 ↓ 0.0 0 7,123

Index Scan using invitations_pkey on invitations (cost=0.14..0.17 rows=1 width=9) (actual time=0.001..0.001 rows=0 loops=7,123)

  • Index Cond: (id = appointments.invitation_id)
33.          

SubPlan (for Nested Loop Left Join)

34. 14.246 23,662.606 ↓ 0.0 0 7,123

Sort (cost=771.85..771.85 rows=2 width=36) (actual time=3.322..3.322 rows=0 loops=7,123)

  • Sort Key: questions.id
  • Sort Method: quicksort Memory: 25kB
35. 7.123 23,648.360 ↓ 0.0 0 7,123

Nested Loop (cost=0.55..771.84 rows=2 width=36) (actual time=3.320..3.320 rows=0 loops=7,123)

36. 14.246 23,641.237 ↓ 0.0 0 7,123

Nested Loop (cost=0.28..771.19 rows=2 width=74) (actual time=3.319..3.319 rows=0 loops=7,123)

37. 23,626.991 23,626.991 ↓ 0.0 0 7,123

Seq Scan on answers (cost=0.00..754.59 rows=2 width=22) (actual time=3.317..3.317 rows=0 loops=7,123)

  • Filter: (appt_id = appointments.id)
  • Rows Removed by Filter: 29,949
38. 0.000 0.000 ↓ 0.0 0

Index Scan using question_pkey on questions (cost=0.28..8.29 rows=1 width=56) (never executed)

  • Index Cond: (id = answers.question_id)
39. 0.000 0.000 ↓ 0.0 0

Index Scan using questionnaire_pkey on questionnaires (cost=0.28..0.32 rows=1 width=10) (never executed)

  • Index Cond: (id = questions.questionnaire_id)
Planning time : 15.259 ms
Execution time : 23,793.371 ms