on 2016 Oct 17 6:15 PM
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.
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
30 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.