explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H162

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=27,375.72..27,375.72 rows=2 width=397) (actual rows= loops=)

  • Sort Key: "filteredPayments".date DESC
2.          

CTE filteredPayments

3. 0.000 0.000 ↓ 0.0

Limit (cost=27,303.22..27,303.33 rows=1 width=107) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Gather Merge (cost=27,279.64..27,303.22 rows=205 width=107) (actual rows= loops=)

  • Workers Planned: 1
5. 0.000 0.000 ↓ 0.0

Sort (cost=26,279.63..26,280.15 rows=205 width=107) (actual rows= loops=)

  • Sort Key: payments.date DESC
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=48.96..26,271.76 rows=205 width=107) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=48.53..19,603.28 rows=921 width=96) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=47.96..12,753.76 rows=921 width=63) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on payments (cost=47.39..7,583.93 rows=1,125 width=59) (actual rows= loops=)

  • Recheck Cond: ("accountId" = 6,139,067)
10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "payments_accountId_date" (cost=0.00..46.91 rows=1,912 width=0) (actual rows= loops=)

  • Index Cond: ("accountId" = 6,139,067)
11. 0.000 0.000 ↓ 0.0

Index Only Scan using "paymentToReservation_uniq_constraint" on "paymentToReservation" ptor (cost=0.57..4.59 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ("paymentId" = payments.id)
12. 0.000 0.000 ↓ 0.0

Index Scan using reservations_pkey on reservations (cost=0.57..7.44 rows=1 width=37) (actual rows= loops=)

  • Index Cond: (id = ptor."reservationId")
13. 0.000 0.000 ↓ 0.0

Index Scan using vehicles_pkey on vehicles (cost=0.43..7.24 rows=1 width=19) (actual rows= loops=)

  • Index Cond: (id = reservations."vehicleId")
  • Filter: (vrp ~~ '%A%'::text)
14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=13.07..72.37 rows=2 width=397) (actual rows= loops=)

  • Join Filter: (("accountTransfers"."writeoffPaymentId" = "filteredPayments".id) OR ("accountTransfers"."refillPaymentId" = "filteredPayments".id))
15. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=13.07..45.08 rows=1 width=1,644) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=12.50..36.49 rows=1 width=341) (actual rows= loops=)

  • Join Filter: ("filteredPayments".id = "filteredPayments_1".id)
17. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.29..25.21 rows=1 width=309) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.86..16.93 rows=1 width=289) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.43..8.47 rows=1 width=285) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

CTE Scan on "filteredPayments" (cost=0.00..0.02 rows=1 width=273) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using "paymentSources_pkey" on "paymentSources" (cost=0.43..8.45 rows=1 width=16) (actual rows= loops=)

  • Index Cond: ("filteredPayments"."sourceId" = id)
22. 0.000 0.000 ↓ 0.0

Index Only Scan using "paymentToGatedParkingSession_uniq_constraint" on "paymentToGatedParkingSession" (cost=0.43..8.45 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ("paymentId" = "filteredPayments".id)
23. 0.000 0.000 ↓ 0.0

Index Scan using "gatedParkingSessions_pkey" on "gatedParkingSessions" (cost=0.43..8.28 rows=1 width=24) (actual rows= loops=)

  • Index Cond: ("paymentToGatedParkingSession"."gatedParkingSessionId" = id)
24. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=11.20..11.26 rows=1 width=36) (actual rows= loops=)

  • Group Key: "filteredPayments_1".id
25. 0.000 0.000 ↓ 0.0

Sort (cost=11.20..11.21 rows=4 width=78) (actual rows= loops=)

  • Sort Key: "filteredPayments_1".id
26. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..11.16 rows=4 width=78) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.00..10.52 rows=4 width=12) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..8.72 rows=4 width=12) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

CTE Scan on "filteredPayments" "filteredPayments_1" (cost=0.00..0.02 rows=1 width=8) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Index Scan using "reservationIntervals_reservationId" on "reservationIntervals" (cost=0.57..8.66 rows=4 width=12) (actual rows= loops=)

  • Index Cond: ("reservationId" = "filteredPayments_1"."reservationId")
31. 0.000 0.000 ↓ 0.0

Index Scan using grants_pkey on grants (cost=0.43..0.45 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = "reservationIntervals"."grantId")
32. 0.000 0.000 ↓ 0.0

Index Scan using benefits_pkey on benefits (cost=0.14..0.16 rows=1 width=74) (actual rows= loops=)

  • Index Cond: (id = grants."benefitId")
33. 0.000 0.000 ↓ 0.0

Index Scan using "transactionExtraFields_transactionId_idx" on "transactionExtraFields" (cost=0.57..8.59 rows=1 width=1,307) (actual rows= loops=)

  • Index Cond: ("transactionId" = "filteredPayments"."transactionId")
34. 0.000 0.000 ↓ 0.0

Seq Scan on "accountTransfers" (cost=0.00..16.30 rows=730 width=110) (actual rows= loops=)