DEV Community

loading...

Discussion on: #SQL30 Day 2: Stock Price Variance

Collapse
helenanders26 profile image
Collapse
zchtodd profile image
zchtodd Author

Almost identical to what I ended up doing, with the exception that I did the month extraction inside of a CTE. Using a CTE to avoid repetition of an expression might sometimes be a bad idea, especially with PG, where I believe all CTEs are materialized. So I probably paid dearly for that little convenience!

I hear though that PG 12 has made some improvements in regards to CTE performance.

Thread Thread
helenanders26 profile image
Helen Anderson

Yes! I am very excited to be able to use CTEs without fear. The release notes for PG12 are out now - postgresql.org/about/news/1976/

Forem Open with the Forem app