How to Fragment a table based on month ?
Posted in 1998
Hi Everybody,
What is the best way to fragment a table based on the month.
In my case, I have the data for last 12 months, there will be some
records beyond the range of 12 months, however it is ok as the
percentage will be very less, say 2 in million.
This works fine
appt_date < '01/01/1998 in dbs_00,
appt_date <= '01/31/1998' and appt_date > '01/01/1998' in dbs_01,
appt_date <= '02/28/1998' and appt_date > '02/01/1998' in dbs_02,
.
.
appt_date <= '12/31/1998' and appt_date > '12/31/1998' in dbs_12,
appt_date > '12/31/1998' in dbs_13
But this is for the current year, I would like to store for last 12
months..
I would like to do something like this
month(appt_date) = 01 in dbs_01,
month(appt_date) = 02 in dbs_02,
.
. month(appt_date) = 12 in dbs_12,
month(appt_date) = 0 or month(appt_date) > 12 in dbs_13
with this type of fragmentation, when I give
select ...
where month(appt_date) = 04 it scans all the fragments
where appt_date = 'mm/dd/yy' it scans only one fragment
where appt_date > 'mm/dd/yy' again it scans all the fragments
Any comments or suggestions.
Thanks,
Sunil Thakkar.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com