First of all, man, that must be the longest question I've seen posted...
Second, you said that your data is collected and tallyed once per day, right? So, what difference does it make if the query is optimized or not? Kick off the tally procedure at 12AM and let it run for 4 hours, if need be. Also, I don't know a whole lot about SQL, but I'm pretty sure its all interpreted. Perhaps the interpreter is "smart" enough to make some kind optimizations on your query or perhaps do some intelligent caching so it isn't too inefficient.
Have you actually implemented this system and noticed a performance issue? Just curious... and sorry I don't have a better answer to your question.
|