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

In MySQL, discovering the UNION hack a couple years ago was like a revelation. It’s something that I’ve since been preaching to everyone who’ll listen.

It’s extremely common to want to OR a small set of items. It feels like the compiler would be smart enough to use an index (presuming one exists matching the searches fields), but it doesn’t. UNION makes it use the index.

It’s a nice tool to have in your kit.

(At least not in 5.6 or 5.7.)




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

Search: