(still catching up!)
Tom,
We have similar queries where I work, and a union is the best way to
go. Leaving the tables large eats up valuable buffer space for us,
putting the logic in the client app is a bad idea (since you'd have to
do it for all apps).
In particular, our sessions table is very
The script to prove it follows.
Splitting a million-row fact table into a 5-part merge table makes
3-second queries take 9 seconds.
The basic problem is this: fact tables are generally referenced by
unique combinations of dimensions, and though often only one
underlying table needs to be referen