Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEFORE:
- QUERY PLAN
- -------------------------------------------------------------------------------------------------------------------------
- Aggregate (cost=119.89..119.90 rows=1 width=8)
- -> Gather Motion 6:1 (slice3; segments: 6) (cost=119.80..119.88 rows=1 width=8)
- -> Aggregate (cost=119.80..119.81 rows=1 width=8)
- -> Hash Left Join (cost=33.02..117.30 rows=167 width=0)
- Hash Cond: casts.actorid = actors.actorid
- -> Redistribute Motion 6:6 (slice2; segments: 6) (cost=21.75..92.75 rows=167 width=4)
- Hash Key: casts.actorid
- -> Hash Left Join (cost=21.75..72.75 rows=167 width=4)
- Hash Cond: casts.movieid = movies.movieid
- -> Redistribute Motion 6:6 (slice1; segments: 6) (cost=0.00..36.00 rows=167 width=8)
- Hash Key: casts.movieid
- -> Seq Scan on casts (cost=0.00..16.00 rows=167 width=8)
- -> Hash (cost=13.00..13.00 rows=117 width=4)
- -> Seq Scan on movies (cost=0.00..13.00 rows=117 width=4)
- -> Hash (cost=8.34..8.34 rows=39 width=4)
- -> Seq Scan on actors (cost=0.00..8.34 rows=39 width=4)
- Optimizer status: legacy query optimizer
- (17 rows)
- AFTER:
- QUERY PLAN
- -------------------------------------------------------------------------------------------------------------------------
- (17 rows)
- ----- Step1 -----
- -> Hash (cost=13.00..13.00 rows=117 width=4)
- ----- Step2 -----
- -> Seq Scan on casts (cost=0.00..16.00 rows=167 width=8)
- Hash Key: casts.movieid
- -> Redistribute Motion 6:6 (slice1; segments: 6) (cost=0.00..36.00 rows=167 width=8)
- Hash Cond: casts.movieid = movies.movieid
- -> Hash Left Join (cost=21.75..72.75 rows=167 width=4)
- Hash Key: casts.actorid
- -> Redistribute Motion 6:6 (slice2; segments: 6) (cost=21.75..92.75 rows=167 width=4)
- Hash Cond: casts.actorid = actors.actorid
- -> Hash Left Join (cost=33.02..117.30 rows=167 width=0)
- -> Aggregate (cost=119.80..119.81 rows=1 width=8)
- -> Gather Motion 6:1 (slice3; segments: 6) (cost=119.80..119.88 rows=1 width=8)
- Aggregate (cost=119.89..119.90 rows=1 width=8)
- -------------------------------------------------------------------------------------------------------------------------
- QUERY PLAN
- 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