Re:Recursive SQL Queries with PostgreSQL
by jimktrains2 on Monday March 16, 2020 @12:42PM
(#22594265)
I'm not disagreeing, but it also helps to look at the EXPLAIN output (including things like width and rows) for queries to better understand what's actually happening. That helps build intuition, but like you said, major version releases can change that behavior. Postgres is usually pretty good at documenting those changes, though.
Re:Recursive SQL Queries with PostgreSQL
by seanhunter on Monday March 16, 2020 @03:33PM
(#22596624)
100% agree.
There has to be more to the situation than the aove. Unless you configured join_collapse_limit to be way lower than the default, the JOIN query just gets transformed into the former.
Any chance you either had a lot more tables joined together, or you were seeing caching effects?
> Conversely, projecting off unnecessary columns used to result in a big speedup.
That also just gets inlined, unless you have more than from_collapse_limit items in the from list. And we push down the list of columns we actually need, so there's nothing this would improve anyway.
Conversely, projecting off unnecessary columns used to result in a big speedup. ie
used to be significantly faster than either of those queries on wide tables.edit: few typos and additional example added