Timeline for How can I make this aggregation query more efficient?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 13, 2016 at 11:15 | vote | accept | Jez | ||
Dec 13, 2016 at 11:15 | history | edited | Jez | CC BY-SA 3.0 |
Added the query I came up with in the end
|
Dec 8, 2016 at 23:43 | history | tweeted | twitter.com/StackDBAs/status/807007824266018817 | ||
Dec 8, 2016 at 22:49 | comment | added | Kin Shah | Sorry .. I see table spool .. but I would still test out with the trace flags as I mentioned above. | |
Dec 8, 2016 at 22:18 | comment | added | Kin Shah |
Try with option (querytraceon 4199, querytraceon 9481) --> Enable all optimizer fixes and use legacy CE. I see it using parallelism and hash join with good seeks & no spool operator. I dont have the data to play, but using fake stats with ROWCOUNT=10000000 I am getting better plan. Obviously, adding appropriate indexes will give it more boost.
|
|
Dec 8, 2016 at 21:26 | answer | added | Daniel Hutmacher | timeline score: 3 | |
Dec 8, 2016 at 20:09 | history | edited | Jez | CC BY-SA 3.0 |
added 580 characters in body
|
Dec 8, 2016 at 19:54 | comment | added | seventyeightist | Can you give an example of the results you expect? Is it a "cross tab" of Records and Users? (with "Number of downloads" or null as the sum that appears in each cell?) | |
Dec 8, 2016 at 18:15 | history | edited | Jez | CC BY-SA 3.0 |
added 22 characters in body
|
Dec 8, 2016 at 18:09 | history | asked | Jez | CC BY-SA 3.0 |