▲ | CGamesPlay 10 hours ago | |||||||
> However, if the example had used UNION instead of UNION ALL, then SQLite would have had to keep around all previously generated content in order to check for duplicates. For this reason, programmers should strive to use UNION ALL instead of UNION when feasible. | ||||||||
▲ | cryptonector 9 hours ago | parent [-] | |||||||
Of course, if you have loop detection in your business logic when writing to the database, then you can safely use UNION ALL always. EDIT: Removed a bunch of stuff that was partly based on a faulty memory of how UNION works vs UNION ALL. Indeed, UNION ALL means the RDBMS does not need to keep around the whole result set. | ||||||||
|