explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nYuX

Settings
# exclusive inclusive rows x rows loops node
1. 0.057 1.170 ↑ 973.9 8 1

Sort (cost=64,074.99..64,094.46 rows=7,791 width=9,463) (actual time=1.169..1.170 rows=8 loops=1)

  • Sort Key: "Result"."createdAt" DESC
  • Sort Method: quicksort Memory: 31kB
2. 0.023 1.113 ↑ 973.9 8 1

Hash Left Join (cost=196.87..403.39 rows=7,791 width=9,463) (actual time=1.078..1.113 rows=8 loops=1)

  • Hash Cond: ("task->taskActions"."tokenId" = "task->taskActions->token"."tokenId")
3. 0.022 1.076 ↑ 973.9 8 1

Hash Left Join (cost=175.39..361.39 rows=7,791 width=9,447) (actual time=1.046..1.076 rows=8 loops=1)

  • Hash Cond: ("Result"."resultId" = task."resultId")
4. 0.022 0.533 ↑ 350.0 8 1

Hash Left Join (cost=156.37..301.73 rows=2,800 width=8,760) (actual time=0.508..0.533 rows=8 loops=1)

  • Hash Cond: ("gameInstance->theme"."themeId" = "gameInstance->theme->themeAssets"."themeId")
5. 0.030 0.487 ↑ 350.0 8 1

Hash Left Join (cost=143.44..252.31 rows=2,800 width=8,192) (actual time=0.468..0.487 rows=8 loops=1)

  • Hash Cond: ("Result"."resultId" = "prizeInstance"."resultId")
6. 0.018 0.162 ↑ 466.7 6 1

Hash Left Join (cost=103.25..173.61 rows=2,800 width=3,178) (actual time=0.153..0.162 rows=6 loops=1)

  • Hash Cond: ("Result"."resultId" = voucher."resultId")
7. 0.021 0.141 ↑ 53.7 6 1

Hash Right Join (cost=75.25..99.73 rows=322 width=3,105) (actual time=0.135..0.141 rows=6 loops=1)

  • Hash Cond: (purchase."resultId" = "Result"."resultId")
8. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on "Purchases" purchase (cost=0.00..15.20 rows=520 width=128) (actual time=0.003..0.003 rows=0 loops=1)

9. 0.004 0.117 ↑ 9.5 6 1

Hash (cost=74.53..74.53 rows=57 width=2,977) (actual time=0.117..0.117 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.018 0.113 ↑ 9.5 6 1

Hash Right Join (cost=49.51..74.53 rows=57 width=2,977) (actual time=0.108..0.113 rows=6 loops=1)

  • Hash Cond: ("gameInstance->possiblePrizes->GameInstancePrizes"."gameInstanceId" = "gameInstance"."gameInstanceId")
11. 0.000 0.003 ↓ 0.0 0 1

Hash Join (cost=10.68..31.83 rows=880 width=2,156) (actual time=0.003..0.003 rows=0 loops=1)

  • Hash Cond: ("gameInstance->possiblePrizes->GameInstancePrizes"."prizeId" = "gameInstance->possiblePrizes"."prizeId")
12. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on "GameInstancePrizes" "gameInstance->possiblePrizes->GameInstancePrizes" (cost=0.00..18.80 rows=880 width=48) (actual time=0.003..0.003 rows=0 loops=1)

13. 0.000 0.000 ↓ 0.0 0

Hash (cost=10.30..10.30 rows=30 width=2,108) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Seq Scan on "Prizes" "gameInstance->possiblePrizes" (cost=0.00..10.30 rows=30 width=2,108) (never executed)

15. 0.003 0.092 ↑ 5.8 6 1

Hash (cost=38.40..38.40 rows=35 width=821) (actual time=0.092..0.092 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.008 0.089 ↑ 5.8 6 1

Nested Loop Left Join (cost=3.98..38.40 rows=35 width=821) (actual time=0.078..0.089 rows=6 loops=1)

17. 0.006 0.075 ↑ 5.8 6 1

Nested Loop Left Join (cost=3.84..29.60 rows=35 width=273) (actual time=0.068..0.075 rows=6 loops=1)

18. 0.018 0.063 ↑ 5.8 6 1

Hash Right Join (cost=3.69..20.54 rows=35 width=237) (actual time=0.059..0.063 rows=6 loops=1)

  • Hash Cond: ("gameInstance"."resultId" = "Result"."resultId")
19. 0.005 0.005 ↑ 135.0 4 1

Seq Scan on "GameInstances" "gameInstance" (cost=0.00..15.40 rows=540 width=121) (actual time=0.005..0.005 rows=4 loops=1)

20. 0.004 0.040 ↑ 1.0 6 1

Hash (cost=3.61..3.61 rows=6 width=116) (actual time=0.040..0.040 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.036 0.036 ↑ 1.0 6 1

Seq Scan on "Results" "Result" (cost=0.00..3.61 rows=6 width=116) (actual time=0.023..0.036 rows=6 loops=1)

  • Filter: ("resultId" = ANY ('{0a87e223-9a41-4a1d-ab4c-435d1020327d,4a627d86-4cd9-4b9b-9845-c1946b8c8c5f,c9641769-865f-43c0-9213-717c0f60b4b5,2645c940-311e-4fc0-850c-b8a20aac727a,1054fd35-7d56-45a8-a78b-8e67da2dda2e,c12342b1-5c58-45a4-8530-27d40836b994}'::uuid[]))
  • Rows Removed by Filter: 86
22. 0.006 0.006 ↓ 0.0 0 6

Index Scan using "Games_pkey" on "Games" "gameInstance->game" (cost=0.15..0.26 rows=1 width=36) (actual time=0.001..0.001 rows=0 loops=6)

  • Index Cond: ("gameInstance"."gameId" = "gameId")
23. 0.006 0.006 ↓ 0.0 0 6

Index Scan using "Themes_pkey" on "Themes" "gameInstance->theme" (cost=0.14..0.25 rows=1 width=548) (actual time=0.001..0.001 rows=0 loops=6)

  • Index Cond: ("gameInstance"."themeId" = "themeId")
24. 0.000 0.003 ↓ 0.0 0 1

Hash (cost=18.00..18.00 rows=800 width=73) (actual time=0.003..0.003 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
25. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on "Vouchers" voucher (cost=0.00..18.00 rows=800 width=73) (actual time=0.003..0.003 rows=0 loops=1)

26. 0.080 0.295 ↓ 1.1 100 1

Hash (cost=39.04..39.04 rows=92 width=5,014) (actual time=0.295..0.295 rows=100 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 43kB
27. 0.046 0.215 ↓ 1.1 100 1

Hash Left Join (cost=34.62..39.04 rows=92 width=5,014) (actual time=0.114..0.215 rows=100 loops=1)

  • Hash Cond: ("prizeInstance"."prizeVoucherId" = "prizeInstance->prizeVoucher"."prizeVoucherId")
28. 0.067 0.150 ↓ 1.1 100 1

Hash Left Join (cost=21.69..25.88 rows=92 width=4,440) (actual time=0.084..0.150 rows=100 loops=1)

  • Hash Cond: ("prizeInstance"."prizeId" = "prizeInstance->prize"."prizeId")
29. 0.017 0.017 ↑ 1.0 92 1

Seq Scan on "PrizeInstances" "prizeInstance" (cost=0.00..2.92 rows=92 width=736) (actual time=0.006..0.017 rows=92 loops=1)

30. 0.012 0.066 ↑ 1.4 21 1

Hash (cost=21.32..21.32 rows=30 width=3,704) (actual time=0.066..0.066 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
31. 0.024 0.054 ↑ 1.4 21 1

Hash Right Join (cost=10.68..21.32 rows=30 width=3,704) (actual time=0.043..0.054 rows=21 loops=1)

  • Hash Cond: ("prizeInstance->prize->prizeOptions"."prizeId" = "prizeInstance->prize"."prizeId")
32. 0.006 0.006 ↑ 8.3 6 1

Seq Scan on "PrizeOptions" "prizeInstance->prize->prizeOptions" (cost=0.00..10.50 rows=50 width=1,596) (actual time=0.005..0.006 rows=6 loops=1)

33. 0.012 0.024 ↑ 1.7 18 1

Hash (cost=10.30..10.30 rows=30 width=2,108) (actual time=0.024..0.024 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
34. 0.012 0.012 ↑ 1.7 18 1

Seq Scan on "Prizes" "prizeInstance->prize" (cost=0.00..10.30 rows=30 width=2,108) (actual time=0.006..0.012 rows=18 loops=1)

35. 0.007 0.019 ↑ 6.2 21 1

Hash (cost=11.30..11.30 rows=130 width=574) (actual time=0.019..0.019 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
36. 0.012 0.012 ↑ 6.2 21 1

Seq Scan on "PrizeVouchers" "prizeInstance->prizeVoucher" (cost=0.00..11.30 rows=130 width=574) (actual time=0.008..0.012 rows=21 loops=1)

37. 0.008 0.024 ↑ 11.8 11 1

Hash (cost=11.30..11.30 rows=130 width=568) (actual time=0.024..0.024 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
38. 0.016 0.016 ↑ 11.8 11 1

Seq Scan on "ThemeAssets" "gameInstance->theme->themeAssets" (cost=0.00..11.30 rows=130 width=568) (actual time=0.013..0.016 rows=11 loops=1)

39. 0.140 0.521 ↑ 1.0 256 1

Hash (cost=15.83..15.83 rows=256 width=687) (actual time=0.521..0.521 rows=256 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 48kB
40. 0.167 0.381 ↓ 1.7 436 1

Hash Right Join (cost=9.76..15.83 rows=256 width=687) (actual time=0.196..0.381 rows=436 loops=1)

  • Hash Cond: ("task->taskActions"."taskId" = task."taskId")
41. 0.036 0.036 ↑ 1.0 242 1

Seq Scan on "TaskActions" "task->taskActions" (cost=0.00..5.42 rows=242 width=50) (actual time=0.007..0.036 rows=242 loops=1)

42. 0.101 0.178 ↑ 1.0 256 1

Hash (cost=6.56..6.56 rows=256 width=653) (actual time=0.177..0.178 rows=256 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 39kB
43. 0.077 0.077 ↑ 1.0 256 1

Seq Scan on "Tasks" task (cost=0.00..6.56 rows=256 width=653) (actual time=0.008..0.077 rows=256 loops=1)

44. 0.007 0.014 ↑ 85.0 6 1

Hash (cost=15.10..15.10 rows=510 width=32) (actual time=0.014..0.014 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
45. 0.007 0.007 ↑ 85.0 6 1

Seq Scan on "Tokens" "task->taskActions->token" (cost=0.00..15.10 rows=510 width=32) (actual time=0.006..0.007 rows=6 loops=1)

Planning time : 4.244 ms
Execution time : 1.644 ms