Forum OpenACS Q&A: Response to Outer join Query for Users_files: Help

Collapse
Posted by Dan Wickstrom on
Oh I understand how the "when exists" clause works, and I understand that using a "group by" statement adds an additional sort stage to a queries execution plan, thus making it slower.  What I was surprised by was the fact that the subselect in the target list was faster than a simple outer-join like the one that I used in my first post.  I've followed several threads on the pg mailing lists where the topic of discussion centered around performance problems with subselects, and I've always assumed that in most cases they are slower than joins.

Things change pretty fast with postgresql, so it's not always safe to make generalized statements with regards to performance.  At least that's what I've learned.