Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, seeing "sort" in the union-based plan also threw me for a moment about why that would be any faster. Normally sorts kill performance, especially compared to the merge join in the "ugly" version.

I think the key is in the description afterwards, where each subquery only returns 1 row. Which just reinforces: measure everything, this advice may not be generally applicable.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: