79179191

Date: 2024-11-11 21:34:19
Score: 1
Natty:
Report link

SO today i was writing a query that "merged two querys with identical structure, 2 int cols and a varchar column - total width 40 bytes..

4,403,063 rows to another of 8,743,056 rows The resulting distinct result set was 8,141,350 rows.

Using a UNION to join both queries between 30 and 40 seconds Using a UNION ALL into a temp table then a SELECT DISTINCT on the temp table 10 seconds.

Dont assume you will see the same result with millions of rows that you see with hundreds or thousands or rows

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: roblem