cancel
Showing results for 
Search instead for 
Did you mean: 

ASE Date range partition

Former Member
0 Kudos
748

We have a table that has between 40 and 60 million rows, and holds 2 to 3 years of data. The most recent 90 days of data accounts for over 80% of the queries. Access to this table is very slow and we're looking at partitioning the table to improve performance. This could even include keeping the last 90 days of data on a high speed device.

Is there any way to define a partition and/or local index to work on a dynamic value, such as "the last 90 days"? How do other users manage this problem? Do we need to manually alter the table to keep the most recent 90 days of data on the fast device? Will ASE automatically transfer data between devices when the partition is altered?

I would expect that this isn't a new problem, but I can't find any specific discussions about it.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

No you can't create a partition based on the last 90 days.

Personally, I'd set up partitions based on quarter of years

ie 2015Q1, 2015Q2, 2015Q3, 2015Q4, 2016Q1, 2016Q2, 2016Q3, 2016Q4

- that would mean that you'd only need to access 2 partitions for the last 90 days.

You could set up a partition per month - but that would mean accessing 3 or 4 partitions for the last 90 days

However, the question is why are you queries slow getting the last 90 days. You could just recluster your table around the date to ensure contiguousness over the last 90 days ?

Personally, I partition date on a year basis because getting large data volumes off the SAN is very slow. Partitioning by year keeps the current year in cache and old years on SAN.

And always a good idea to pre-create partitions into the future.