Timeline for More efficient SQL for different databases with same schema
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 30, 2016 at 22:28 | comment | added | xxCDxx |
Ran my original SQL, Dudu and TypoCube's multiple times with UNION & UNION ALL . Times from SAS log and queries ran on server. Times for same query varied depending on server activity. I know it was a very amateur test but was good enough for me: - My original query was consistently slower for all. - Using the WHERE clause inside the derived table didn't make noticeable difference so I left it outside for a shorter query per Dudu. - UNION ALL was noticeable faster on all tests than UNION . Unfortunately I found duplicates that need to be deleted so have to use UNION .
|
|
Dec 30, 2016 at 20:08 | history | edited | David דודו Markovitz | CC BY-SA 3.0 |
added 157 characters in body
|
Dec 30, 2016 at 19:59 | vote | accept | xxCDxx | ||
Dec 30, 2016 at 19:59 | comment | added | xxCDxx |
yep. sorry. just saw the WHERE at the end.
|
|
Dec 30, 2016 at 19:57 | comment | added | ypercubeᵀᴹ |
It's actually shorter, only one WHERE . Mine repeats for each one of the 12 tables
|
|
Dec 30, 2016 at 17:49 | history | answered | David דודו Markovitz | CC BY-SA 3.0 |