explain.depesz.com

A tool for finding a real cause for slow queries.

Result: ACA : noncartdonationpaymentview

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 138.457 58,777.832 ↑ 4,983.7 10 1

Merge IN Join (cost=879,725.14..891,760.80 rows=49,837 width=268) (actual time=58,777.763..58,777.832 rows=10 loops=1)

  • Merge Cond: (noncartdonationpaymentview.donationid = "IN_subquery".donationid)
2. 1,240.059 58,639.103 ↑ 3.3 300,694 1

GroupAggregate (cost=879,716.61..890,431.59 rows=996,742 width=75) (actual time=57,182.887..58,639.103 rows=300,694 loops=1)

3. 809.133 57,399.044 ↑ 3.2 308,601 1

Sort (cost=879,716.61..879,965.80 rows=996,742 width=75) (actual time=57,182.837..57,399.044 rows=308,601 loops=1)

  • Sort Key: ncd.donationid, CASE WHEN (dyi_ah_match.matchingtype = 0) THEN 'double_your_impact_match'::text WHEN (dyi_ah_match.matchingtype = 1) THEN 'almost_home_match'::text WHEN (citizen_side_of_promo_match.donationid IS NOT NULL) THEN 'promo_code_match'::text ELSE NULL::text END
4. 789.641 56,589.911 ↑ 3.2 308,601 1

Hash Left Join (cost=788,764.51..825,496.64 rows=996,742 width=75) (actual time=56,172.116..56,589.911 rows=308,601 loops=1)

  • Hash Cond: (ncd.sponsordonationid = sponsor_side_of_promo_match.donationid)
5. 1,041.753 52,882.579 ↑ 3.2 308,601 1

Merge Right Join (cost=731,784.54..733,828.91 rows=996,742 width=75) (actual time=49,710.517..52,882.579 rows=308,601 loops=1)

  • Merge Cond: (citizen_side_of_promo_match.sponsordonationid = ncd.donationid)
6. 1,925.111 1,925.111 ↑ 1.0 1,763,099 1

Index Scan using uix_dcdonation_sponsordonationid on dcdonation citizen_side_of_promo_match (cost=0.00..126,460.12 rows=1,763,099 width=8) (actual time=0.051..1,925.111 rows=1,763,099 loops=1)

7. 994.024 49,915.715 ↑ 3.2 308,601 1

Sort (cost=731,784.54..732,033.72 rows=996,742 width=71) (actual time=49,710.458..49,915.715 rows=308,601 loops=1)

  • Sort Key: ncd.donationid
8. 319.695 48,921.691 ↑ 3.2 308,601 1

Hash Left Join (cost=398,121.90..679,265.57 rows=996,742 width=71) (actual time=47,778.251..48,921.691 rows=308,601 loops=1)

  • Hash Cond: ((ncd.donorid = dyi_ah_match.donorid) AND (p.completedmatchingid = dyi_ah_match.matchingid))
9. 492.011 48,600.503 ↑ 3.2 308,601 1

Hash Left Join (cost=398,045.90..678,442.00 rows=996,742 width=75) (actual time=47,776.738..48,600.503 rows=308,601 loops=1)

  • Hash Cond: (gc.giftpurchaseid = gp.id)
10. 668.936 47,872.256 ↑ 3.2 308,601 1

Hash Left Join (cost=392,885.45..650,326.29 rows=996,742 width=50) (actual time=47,540.477..47,872.256 rows=308,601 loops=1)

  • Hash Cond: (pay.charge = ccc.id)
11. 817.184 46,553.172 ↑ 3.2 308,601 1

Hash Join (cost=379,627.56..615,057.95 rows=996,742 width=47) (actual time=24,041.009..46,553.172 rows=308,601 loops=1)

  • Hash Cond: (ncd.proposalid = p.proposalid)
12. 1,109.868 38,917.582 ↑ 3.2 308,601 1

Hash Left Join (cost=276,436.42..488,469.91 rows=996,742 width=47) (actual time=17,222.564..38,917.582 rows=308,601 loops=1)

  • Hash Cond: (pay.accountdebitid = ad.transactionid)
13. 1,527.867 20,589.489 ↑ 3.2 308,601 1

Merge Left Join (cost=0.00..185,685.65 rows=996,742 width=47) (actual time=0.187..20,589.489 rows=308,601 loops=1)

  • Merge Cond: (ncd.donationid = pay.donationid)
14. 3,231.942 17,018.345 ↑ 2.9 300,694 1

Merge Left Join (cost=0.00..138,304.25 rows=881,550 width=16) (actual time=0.117..17,018.345 rows=300,694 loops=1)

  • Merge Cond: (ncd.donationid = item.donation)
  • Filter: (item.cart IS NULL)
15. 2,388.202 2,388.202 ↑ 1.0 1,763,099 1

Index Scan using pk_dcdonation on dcdonation ncd (cost=0.00..92,615.28 rows=1,763,099 width=16) (actual time=0.046..2,388.202 rows=1,763,099 loops=1)

16. 11,398.201 11,398.201 ↑ 1.0 2,525,662 1

Index Scan using giving_cart_item_donation on giving_cart_item item (cost=0.00..75,078.09 rows=2,525,662 width=8) (actual time=0.061..11,398.201 rows=2,525,662 loops=1)

17. 2,043.277 2,043.277 ↑ 1.1 1,989,220 1

Index Scan using payment_altindex1 on payment pay (cost=0.00..48,778.19 rows=2,129,133 width=35) (actual time=0.065..2,043.277 rows=1,989,220 loops=1)

18. 972.111 17,218.225 ↑ 1.0 1,453,800 1

Hash (cost=268,230.17..268,230.17 rows=1,453,800 width=8) (actual time=17,218.225..17,218.225 rows=1,453,800 loops=1)

19. 6,346.392 16,246.114 ↑ 1.0 1,453,800 1

Merge Left Join (cost=0.00..268,230.17 rows=1,453,800 width=8) (actual time=0.117..16,246.114 rows=1,453,800 loops=1)

  • Merge Cond: (ad.giftcodeid = gc.id)
20. 1,603.490 1,603.490 ↑ 1.0 1,453,800 1

Index Scan using accountdebit_giftcodeid on accountdebit ad (cost=0.00..27,554.09 rows=1,453,800 width=8) (actual time=0.043..1,603.490 rows=1,453,800 loops=1)

21. 8,296.232 8,296.232 ↓ 1.0 10,484,041 1

Index Scan using pk_giftcode on giftcode gc (cost=0.00..236,524.82 rows=10,293,956 width=8) (actual time=0.067..8,296.232 rows=10,484,041 loops=1)

22. 532.547 6,818.406 ↑ 1.0 689,844 1

Hash (cost=99,296.84..99,296.84 rows=689,844 width=8) (actual time=6,818.406..6,818.406 rows=689,844 loops=1)

23. 6,285.859 6,285.859 ↑ 1.0 689,844 1

Seq Scan on dcproposal p (cost=0.00..99,296.84 rows=689,844 width=8) (actual time=0.019..6,285.859 rows=689,844 loops=1)

24. 293.132 650.148 ↑ 1.0 437,728 1

Hash (cost=10,572.73..10,572.73 rows=437,728 width=11) (actual time=650.148..650.148 rows=437,728 loops=1)

25. 357.016 357.016 ↑ 1.0 437,728 1

Seq Scan on credit_card_charge ccc (cost=0.00..10,572.73 rows=437,728 width=11) (actual time=0.019..357.016 rows=437,728 loops=1)

26. 102.610 236.236 ↑ 1.0 143,308 1

Hash (cost=3,861.31..3,861.31 rows=143,308 width=33) (actual time=236.236..236.236 rows=143,308 loops=1)

27. 133.626 133.626 ↑ 1.0 143,308 1

Seq Scan on giftpurchase gp (cost=0.00..3,861.31 rows=143,308 width=33) (actual time=0.028..133.626 rows=143,308 loops=1)

28. 0.268 1.493 ↑ 1.0 403 1

Hash (cost=75.40..75.40 rows=403 width=12) (actual time=1.493..1.493 rows=403 loops=1)

29. 1.225 1.225 ↑ 1.0 403 1

Seq Scan on matching dyi_ah_match (cost=0.00..75.40 rows=403 width=12) (actual time=0.022..1.225 rows=403 loops=1)

30. 1,105.538 2,917.691 ↑ 1.0 1,763,099 1

Hash (cost=47,028.10..47,028.10 rows=1,763,099 width=8) (actual time=2,917.691..2,917.691 rows=1,763,099 loops=1)

31. 1,812.153 1,812.153 ↑ 1.0 1,763,099 1

Seq Scan on dcdonation sponsor_side_of_promo_match (cost=0.00..47,028.10 rows=1,763,099 width=8) (actual time=0.016..1,812.153 rows=1,763,099 loops=1)

32. 0.025 0.272 ↑ 1.0 10 1

Sort (cost=8.53..8.53 rows=10 width=4) (actual time=0.265..0.272 rows=10 loops=1)

  • Sort Key: "IN_subquery".donationid
33. 0.009 0.247 ↑ 1.0 10 1

Limit (cost=0.00..8.50 rows=10 width=4) (actual time=0.096..0.247 rows=10 loops=1)

34. 0.044 0.238 ↑ 88,155.0 10 1

Nested Loop Left Join (cost=0.00..749,559.12 rows=881,550 width=4) (actual time=0.095..0.238 rows=10 loops=1)

  • Filter: (item.cart IS NULL)
35. 0.069 0.069 ↑ 70,524.0 25 1

Index Scan Backward using pk_dcdonation on dcdonation ncd (cost=0.00..92,615.28 rows=1,763,099 width=4) (actual time=0.049..0.069 rows=25 loops=1)

36. 0.125 0.125 ↑ 1.0 1 25

Index Scan using giving_cart_item_donation on giving_cart_item item (cost=0.00..0.37 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=25)

  • Index Cond: (item.donation = ncd.donationid)