explain.depesz.com

PostgreSQL's explain analyze made readable

Result: a9It

Settings
# exclusive inclusive rows x rows loops node
1. 2,067.803 6,136.698 ↑ 16.4 34,355 1

Hash Left Join (cost=84,074.25..27,803,596.65 rows=562,810 width=770) (actual time=959.072..6,136.698 rows=34,355 loops=1)

  • Hash Cond: (l."Id" = ps.event_id)
2.          

CTE price_suggest

3. 1.003 1.625 ↓ 1.0 1,330 1

HashAggregate (cost=96.81..110.00 rows=1,319 width=16) (actual time=1.249..1.625 rows=1,330 loops=1)

  • Group Key: activity_listing."EventSSId
4. 0.622 0.622 ↓ 1.0 1,603 1

Seq Scan on activity_listing (cost=0.00..88.87 rows=1,587 width=16) (actual time=0.004..0.622 rows=1,603 loops=1)

5. 36.508 2,932.428 ↑ 16.4 34,355 1

Hash Left Join (cost=83,921.38..14,443,526.09 rows=562,810 width=706) (actual time=950.665..2,932.428 rows=34,355 loops=1)

  • Hash Cond: (l."Id" = hl."EventSSId")
6. 59.812 2,895.893 ↑ 16.4 34,355 1

Nested Loop Left Join (cost=83,920.02..14,442,047.18 rows=562,810 width=678) (actual time=950.623..2,895.893 rows=34,355 loops=1)

7. 48.783 2,526.886 ↑ 16.4 34,355 1

Nested Loop Left Join (cost=83,911.71..9,746,804.75 rows=562,810 width=607) (actual time=950.568..2,526.886 rows=34,355 loops=1)

8. 48.793 2,203.263 ↑ 16.4 34,355 1

Nested Loop Left Join (cost=83,903.16..4,922,702.64 rows=562,810 width=563) (actual time=950.540..2,203.263 rows=34,355 loops=1)

9. 35.413 1,536.080 ↑ 16.4 34,355 1

Hash Left Join (cost=83,894.62..98,600.52 rows=562,810 width=547) (actual time=949.382..1,536.080 rows=34,355 loops=1)

  • Hash Cond: (l."TicketRequestId" = sl."TicketRequestId")
10. 46.778 1,458.130 ↑ 16.4 34,355 1

Hash Left Join (cost=80,057.12..92,324.56 rows=562,810 width=543) (actual time=906.829..1,458.130 rows=34,355 loops=1)

  • Hash Cond: (e.venue_id = v.venue_id)
11. 214.078 1,406.199 ↑ 16.4 34,355 1

Merge Join (cost=79,597.33..90,386.59 rows=562,810 width=522) (actual time=901.623..1,406.199 rows=34,355 loops=1)

  • Merge Cond: (l."ApiEventId" = ((e.event_id)::integer))
12. 121.515 375.976 ↓ 1.0 34,941 1

Sort (cost=22,216.70..22,302.89 rows=34,476 width=454) (actual time=335.498..375.976 rows=34,941 loops=1)

  • Sort Key: l."ApiEventId
  • Sort Method: external merge Disk: 12664kB
13. 28.730 254.461 ↓ 1.0 34,941 1

Hash Left Join (cost=5,273.35..12,544.87 rows=34,476 width=454) (actual time=83.655..254.461 rows=34,941 loops=1)

  • Hash Cond: (l."Id" = i."EventSSId")
14. 29.277 213.352 ↓ 1.0 34,740 1

Hash Left Join (cost=4,817.70..11,246.52 rows=34,476 width=426) (actual time=71.193..213.352 rows=34,740 loops=1)

  • Hash Cond: (l."Id" = g."EventSSId")
15. 24.697 169.537 ↓ 1.0 34,740 1

Hash Join (cost=4,098.57..10,436.89 rows=34,476 width=422) (actual time=56.511..169.537 rows=34,740 loops=1)

  • Hash Cond: (u."TenantId" = t."Id")
16. 57.872 143.935 ↓ 1.0 34,740 1

Hash Join (cost=3,916.46..9,780.73 rows=34,476 width=404) (actual time=55.593..143.935 rows=34,740 loops=1)

  • Hash Cond: (l."UserId" = u."Id")
17. 30.683 30.683 ↓ 1.0 34,740 1

Seq Scan on "EventSS" l (cost=0.00..2,225.76 rows=34,476 width=313) (actual time=0.006..30.683 rows=34,740 loops=1)

18. 25.213 55.380 ↑ 1.0 35,046 1

Hash (cost=2,825.87..2,825.87 rows=35,087 width=128) (actual time=55.379..55.380 rows=35,046 loops=1)

  • Buckets: 32768 Batches: 2 Memory Usage: 2777kB
19. 30.167 30.167 ↑ 1.0 35,046 1

Seq Scan on "AspNetUsers" u (cost=0.00..2,825.87 rows=35,087 width=128) (actual time=0.004..30.167 rows=35,046 loops=1)

20. 0.421 0.905 ↓ 1.0 1,206 1

Hash (cost=167.05..167.05 rows=1,205 width=22) (actual time=0.905..0.905 rows=1,206 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 83kB
21. 0.484 0.484 ↓ 1.0 1,206 1

Seq Scan on "Tenants" t (cost=0.00..167.05 rows=1,205 width=22) (actual time=0.006..0.484 rows=1,206 loops=1)

22. 7.841 14.538 ↓ 1.0 25,837 1

Hash (cost=397.39..397.39 rows=25,739 width=12) (actual time=14.538..14.538 rows=25,837 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1468kB
23. 6.697 6.697 ↓ 1.0 25,837 1

Seq Scan on "ListingTicketGroup" g (cost=0.00..397.39 rows=25,739 width=12) (actual time=0.010..6.697 rows=25,837 loops=1)

24. 3.860 12.379 ↑ 1.0 10,944 1

Hash (cost=318.07..318.07 rows=11,007 width=36) (actual time=12.379..12.379 rows=10,944 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 898kB
25. 3.893 8.519 ↑ 1.0 10,944 1

Append (cost=0.00..318.07 rows=11,007 width=36) (actual time=0.011..8.519 rows=10,944 loops=1)

26. 4.561 4.561 ↑ 1.0 10,810 1

Seq Scan on "ListingSoldInvoices" i (cost=0.00..311.74 rows=10,874 width=36) (actual time=0.010..4.561 rows=10,810 loops=1)

27. 0.065 0.065 ↓ 1.0 134 1

Seq Scan on resale_invoices i_1 (cost=0.00..6.33 rows=133 width=36) (actual time=0.008..0.065 rows=134 loops=1)

28. 121.556 816.145 ↓ 1.1 289,132 1

Materialize (cost=57,380.62..58,743.65 rows=272,606 width=76) (actual time=565.579..816.145 rows=289,132 loops=1)

29. 390.506 694.589 ↑ 1.0 272,377 1

Sort (cost=57,380.62..58,062.14 rows=272,606 width=76) (actual time=565.575..694.589 rows=272,377 loops=1)

  • Sort Key: ((e.event_id)::integer)
  • Sort Method: external merge Disk: 25656kB
30. 207.966 304.083 ↑ 1.0 272,594 1

Hash Left Join (cost=1,319.42..20,655.63 rows=272,606 width=76) (actual time=26.117..304.083 rows=272,594 loops=1)

  • Hash Cond: (e.city_id = c.city_id)
31. 70.232 70.232 ↑ 1.0 272,594 1

Seq Scan on tn_events e (cost=0.00..15,588.06 rows=272,606 width=65) (actual time=0.013..70.232 rows=272,594 loops=1)

32. 13.302 25.885 ↑ 1.0 36,863 1

Hash (cost=858.63..858.63 rows=36,863 width=19) (actual time=25.885..25.885 rows=36,863 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2437kB
33. 12.583 12.583 ↑ 1.0 36,863 1

Seq Scan on mv_city_state_country c (cost=0.00..858.63 rows=36,863 width=19) (actual time=0.007..12.583 rows=36,863 loops=1)

34. 2.534 5.153 ↑ 1.0 7,813 1

Hash (cost=362.13..362.13 rows=7,813 width=33) (actual time=5.153..5.153 rows=7,813 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 589kB
35. 2.619 2.619 ↑ 1.0 7,813 1

Seq Scan on tn_venues v (cost=0.00..362.13 rows=7,813 width=33) (actual time=0.012..2.619 rows=7,813 loops=1)

36. 2.329 42.537 ↓ 1.0 7,732 1

Hash (cost=3,740.96..3,740.96 rows=7,723 width=8) (actual time=42.536..42.537 rows=7,732 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 367kB
37. 4.513 40.208 ↓ 1.0 7,732 1

Hash Left Join (cost=3,264.46..3,740.96 rows=7,723 width=8) (actual time=33.744..40.208 rows=7,732 loops=1)

  • Hash Cond: (sl."UserId" = slu."Id")
38. 2.195 2.195 ↓ 1.0 7,732 1

Seq Scan on "Resale" sl (cost=0.00..456.23 rows=7,723 width=41) (actual time=0.005..2.195 rows=7,732 loops=1)

39. 13.038 33.500 ↑ 1.0 35,046 1

Hash (cost=2,825.87..2,825.87 rows=35,087 width=41) (actual time=33.500..33.500 rows=35,046 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3011kB
40. 20.462 20.462 ↑ 1.0 35,046 1

Seq Scan on "AspNetUsers" slu (cost=0.00..2,825.87 rows=35,087 width=41) (actual time=0.006..20.462 rows=35,046 loops=1)

41. 34.355 618.390 ↑ 1.0 1 34,355

Subquery Scan on b (cost=8.55..8.56 rows=1 width=24) (actual time=0.017..0.018 rows=1 loops=34,355)

  • Filter: (b."EventSSId" = l."Id")
42. 68.710 584.035 ↑ 1.0 1 34,355

Limit (cost=8.55..8.55 rows=1 width=32) (actual time=0.016..0.017 rows=1 loops=34,355)

43. 103.065 515.325 ↑ 2.0 1 34,355

Sort (cost=8.55..8.55 rows=2 width=32) (actual time=0.015..0.015 rows=1 loops=34,355)

  • Sort Key: "SyncToPosHistory"."Id
  • Sort Method: quicksort Memory: 25kB
44. 412.260 412.260 ↑ 1.0 2 34,355

Index Scan using idx_synctoposhistory_eventssid on "SyncToPosHistory" (cost=0.29..8.54 rows=2 width=32) (actual time=0.007..0.012 rows=2 loops=34,355)

  • Index Cond: ("EventSSId" = l."Id")
45. 34.355 274.840 ↑ 1.0 1 34,355

Subquery Scan on s (cost=8.55..8.56 rows=1 width=52) (actual time=0.007..0.008 rows=1 loops=34,355)

  • Filter: (s."EventSSId" = l."Id")
46. 68.710 240.485 ↑ 1.0 1 34,355

Limit (cost=8.55..8.55 rows=1 width=161) (actual time=0.006..0.007 rows=1 loops=34,355)

47. 68.710 171.775 ↑ 2.0 1 34,355

Sort (cost=8.55..8.55 rows=2 width=161) (actual time=0.005..0.005 rows=1 loops=34,355)

  • Sort Key: "SyncToPosHistory_1"."Id" DESC
  • Sort Method: quicksort Memory: 25kB
48. 103.065 103.065 ↑ 1.0 2 34,355

Index Scan using idx_synctoposhistory_eventssid on "SyncToPosHistory" "SyncToPosHistory_1" (cost=0.29..8.54 rows=2 width=161) (actual time=0.002..0.003 rows=2 loops=34,355)

  • Index Cond: ("EventSSId" = l."Id")
49. 34.355 309.195 ↑ 1.0 1 34,355

Subquery Scan on p (cost=8.31..8.33 rows=1 width=79) (actual time=0.008..0.009 rows=1 loops=34,355)

  • Filter: (p."EventSSId" = l."Id")
50. 34.355 274.840 ↑ 1.0 1 34,355

Limit (cost=8.31..8.32 rows=1 width=111) (actual time=0.008..0.008 rows=1 loops=34,355)

51. 68.710 240.485 ↑ 1.0 1 34,355

Sort (cost=8.31..8.32 rows=1 width=111) (actual time=0.007..0.007 rows=1 loops=34,355)

  • Sort Key: "UploadToPosHistory"."Id" DESC
  • Sort Method: quicksort Memory: 25kB
52. 171.775 171.775 ↑ 1.0 1 34,355

Index Scan using "fki_FK_UploadToPosHistory_Listings" on "UploadToPosHistory" (cost=0.29..8.30 rows=1 width=111) (actual time=0.005..0.005 rows=1 loops=34,355)

  • Index Cond: ("EventSSId" = l."Id")
53. 0.012 0.027 ↓ 1.7 27 1

Hash (cost=1.16..1.16 rows=16 width=36) (actual time=0.027..0.027 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
54. 0.015 0.015 ↓ 1.7 27 1

Seq Scan on "HoldListing" hl (cost=0.00..1.16 rows=16 width=36) (actual time=0.007..0.015 rows=27 loops=1)

55. 0.415 2.752 ↓ 1.0 1,330 1

Hash (cost=26.38..26.38 rows=1,319 width=16) (actual time=2.752..2.752 rows=1,330 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
56. 2.337 2.337 ↓ 1.0 1,330 1

CTE Scan on price_suggest ps (cost=0.00..26.38 rows=1,319 width=16) (actual time=1.252..2.337 rows=1,330 loops=1)

57.          

SubPlan (forHash Left Join)

58. 68.710 1,133.715 ↑ 1.0 1 34,355

Aggregate (cost=23.29..23.30 rows=1 width=8) (actual time=0.033..0.033 rows=1 loops=34,355)

59. 45.975 1,065.005 ↑ 1.0 1 34,355

Nested Loop (cost=0.57..23.29 rows=1 width=4) (actual time=0.023..0.031 rows=1 loops=34,355)

60. 309.195 309.195 ↑ 1.0 1 34,355

Index Scan using idx_eventss_listingid on "EventSS" ess (cost=0.29..8.31 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=34,355)

  • Index Cond: ("ListingId" = l."ListingId")
61. 125.265 709.835 ↓ 0.0 0 41,755

Append (cost=0.29..14.96 rows=2 width=12) (actual time=0.011..0.017 rows=0 loops=41,755)

62. 83.510 83.510 ↓ 0.0 0 41,755

Index Scan using idx_listingsoldinvoices_eventssid on "ListingSoldInvoices" lsi (cost=0.29..8.30 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=41,755)

  • Index Cond: ("EventSSId" = ess."Id")
63. 501.060 501.060 ↓ 0.0 0 41,755

Seq Scan on resale_invoices lsi_1 (cost=0.00..6.66 rows=1 width=12) (actual time=0.012..0.012 rows=0 loops=41,755)

  • Filter: (ess."Id" = "EventSSId")
  • Rows Removed by Filter: 134
Planning time : 24.711 ms
Execution time : 6,153.005 ms