We recently added a new database at the company. It has only one
purpose - to hold massive amounts a daily data generated by telephone
calls on a network.
The amount of data was so large (several gigabytes a day) that the guy
who set up the database creates a new table for it each day.
His thinking was that if we only need to query one day's worth of data
then it would be a lot faster to query a table with one day's data
than having to query many days of data in one table.
I see his reasoning. Any comments or alternatives to this scheme
would be appreciated.
Here's the question though...I'm writing a front end for this and was
wondering if the most efficient way to query and sum data across
multiple tables (days) is in the form of the following statement.
Suppose three days of worth of data are wanted:
select sum(ET) from (select sum(vc_elapsed_time) AS ET from
switch2030608 where init_cell_info_cell = 196 union all select
sum(vc_elapsed_time) as ET from switch2030609 where
init_cell_info_cell = 196 union all select sum(vc_elapsed_time) as ET
from switch2030610 where init_cell_info_cell = 196 ) t
In my front end, based on user input, I plan to keep extending this
statement with more union alls. Is this the best way to implement the
goal of this query?
-David