3 ms·
hopefully you'll forgive my pedantry - "union all" is vertical concat - "union" without the "all" gives you the distinct list
by coremoff 4y ago
hopefully you'll forgive my pedantry - "union all" is vertical concat - "union" without the "all" gives you the distinct list
- jhgb 4y agoOne of the reasons why SQL is crap: there should be no distinction between the two in relational algebra. A set of {A, B, C, B, C} is the same as {A, B, C}.
- ttfkam 4y agoDetecting duplicates has a cost you can't just hand-wave away. UNION ALL tells the engine not to worry about it and just output as it sees it, usually going faster. Depends on your data needs.
- jhgb 4y agoAnd not treating relationships as sets has costs of its own -- for example it breaks relational formula equivalences that could be used for query optimization.
- intelijstupide 4y ago
- SnowHill9902 4y agoFor some definitions of same as.