Thanks. This video is a lesson from my HIgh-Performance SQL video course, so if you liked it, you are going to love the video course. vladmihalceastore.teachable.com/p/high-performance-sql-online?coupon_code=BLACKFRIDAY23
Hi Vlad, thanks for your video. May I have several questions as below: 1. why when the first statement "select 0,0" executed, then these 0,0 sent to i, and consecutive_sum? while the whole statements within "With" haven't finished yet? 2. IN the second statment i.e. recursive statement "select i + 1, i + 1 + consecutive_sum from consecutive_sum_number" And when i + 1, i+1 + consecutive_sum will be sent to i, and consecutive_sum again for the next iteration? In short, it doesn't look like a native recursive isn't it? cause it doesn't seem to be function call same function, so everytime when consecutive_sum is call then within this function we have select 0,0, union with something. it quite confused me. Thank you
SQL is a declarative language. You're analyzing the query definition using a procedural mindset. That's why it confused you. What you need to do is run EXPLAIN ANALYZE on the query and see exactly the stream operations done by the DB when executing the query.
Excellent content. Very well explained. Thanks Vlad!
Thanks, Diego. There are more to come.
Nice explanation!
Thanks. This video is a lesson from my HIgh-Performance SQL video course, so if you liked it, you are going to love the video course.
vladmihalceastore.teachable.com/p/high-performance-sql-online?coupon_code=BLACKFRIDAY23
Hi Vlad, thanks for your video. May I have several questions as below:
1. why when the first statement "select 0,0" executed, then these 0,0 sent to i, and consecutive_sum? while the whole statements within "With" haven't finished yet?
2. IN the second statment i.e. recursive statement "select i + 1, i + 1 + consecutive_sum from consecutive_sum_number" And when i + 1, i+1 + consecutive_sum will be sent to i, and consecutive_sum again for the next iteration?
In short, it doesn't look like a native recursive isn't it? cause it doesn't seem to be function call same function, so everytime when consecutive_sum is call then within this function we have select 0,0, union with something. it quite confused me.
Thank you
SQL is a declarative language. You're analyzing the query definition using a procedural mindset. That's why it confused you.
What you need to do is run EXPLAIN ANALYZE on the query and see exactly the stream operations done by the DB when executing the query.
@@vladmihalcea Thanks Vlad, will try to explore more. anyway subcribed to your channel to see more useful contents.