Comment

Report: Trump Played Golf and Ignored the Puerto Rico Disaster Until He Saw Pictures on TV

122
Charles Johnson9/29/2017 7:53:15 pm PDT

re: #106 Quoth the raven, Covfefe.

UNION and UNION ALL are pretty nice. It came in handy for a recent project where I needed to return a single dataset for two different logical queries. My development team wrote it as one big query with multiple WHERE clauses joined by an OR, which resulted in horrible performance (single-digit seconds even for an empty record set). Splitting those OR statements into two queries joined by a UNION ALL completely resolved that performance issue.

Yes, I originally wrote it as an ugly 3-table JOIN statement, and it worked but it was taking way too long to execute. The UNION version kicked booty.