Advertisement
Guest User

B & A

a guest
Mar 15th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. BEFORE:
  2. QUERY PLAN
  3. -------------------------------------------------------------------------------------------------------------------------
  4. Aggregate (cost=119.89..119.90 rows=1 width=8)
  5. -> Gather Motion 6:1 (slice3; segments: 6) (cost=119.80..119.88 rows=1 width=8)
  6. -> Aggregate (cost=119.80..119.81 rows=1 width=8)
  7. -> Hash Left Join (cost=33.02..117.30 rows=167 width=0)
  8. Hash Cond: casts.actorid = actors.actorid
  9. -> Redistribute Motion 6:6 (slice2; segments: 6) (cost=21.75..92.75 rows=167 width=4)
  10. Hash Key: casts.actorid
  11. -> Hash Left Join (cost=21.75..72.75 rows=167 width=4)
  12. Hash Cond: casts.movieid = movies.movieid
  13. -> Redistribute Motion 6:6 (slice1; segments: 6) (cost=0.00..36.00 rows=167 width=8)
  14. Hash Key: casts.movieid
  15. -> Seq Scan on casts (cost=0.00..16.00 rows=167 width=8)
  16. -> Hash (cost=13.00..13.00 rows=117 width=4)
  17. -> Seq Scan on movies (cost=0.00..13.00 rows=117 width=4)
  18. -> Hash (cost=8.34..8.34 rows=39 width=4)
  19. -> Seq Scan on actors (cost=0.00..8.34 rows=39 width=4)
  20. Optimizer status: legacy query optimizer
  21. (17 rows)
  22.  
  23.  
  24. AFTER:
  25.  
  26. QUERY PLAN
  27. -------------------------------------------------------------------------------------------------------------------------
  28. (17 rows)
  29. ----- Step1 -----
  30.  
  31. -> Hash (cost=13.00..13.00 rows=117 width=4)
  32.  
  33. ----- Step2 -----
  34.  
  35. -> Seq Scan on casts (cost=0.00..16.00 rows=167 width=8)
  36. Hash Key: casts.movieid
  37. -> Redistribute Motion 6:6 (slice1; segments: 6) (cost=0.00..36.00 rows=167 width=8)
  38. Hash Cond: casts.movieid = movies.movieid
  39. -> Hash Left Join (cost=21.75..72.75 rows=167 width=4)
  40. Hash Key: casts.actorid
  41. -> Redistribute Motion 6:6 (slice2; segments: 6) (cost=21.75..92.75 rows=167 width=4)
  42. Hash Cond: casts.actorid = actors.actorid
  43. -> Hash Left Join (cost=33.02..117.30 rows=167 width=0)
  44. -> Aggregate (cost=119.80..119.81 rows=1 width=8)
  45. -> Gather Motion 6:1 (slice3; segments: 6) (cost=119.80..119.88 rows=1 width=8)
  46. Aggregate (cost=119.89..119.90 rows=1 width=8)
  47. -------------------------------------------------------------------------------------------------------------------------
  48. QUERY PLAN
  49.  
  50.  
  51. So I tried to make it more understandable. I just need to understand the code more within this, I turned the code upside down as you can see because that's how it usually reads well.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement