partitioning database after decade growth

25112
25112 used Ask the Experts™
on
pl see chart.{it includes data+index together} (SQL 2008R2)

after 10 years, db nearing 600GB.. what are best standards to break this for performance (perhaps by years of data, since all records have timestamp)

and reports are often done on 8 years of data.
600.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Vitor MontalvãoIT Engineer
Distinguished Expert 2017

Commented:
You gave only the database size. Partitioning is only for tables so you should start to filter only for large tables. For example, how many tables do you have that are more than 20GB size?
Instead of partitioning you can also move the old data to an archived database. This will be good if you know that older data won't be needed anymore but you still have it archived just in case of future need.
ste5anSenior Developer

Commented:
Hard to tell as already Vitor said..

But partitioning alone is normally not the solution. Also distribute your data over multiple file groups. This allows you to deactivate old data without much hassle (it's then a simple meta operation instead of a delete). The only thing you need to consider is a rolling window.

8 years of data
A fixed time frame or rolling window? In the later case you need to consider one partition per year and a rolling window approach to add new years.

Author

Commented:
1.
>>how many tables do you have that are more than 20GB size?
five)
171.449218 (in GB)
85.838867
48.428710
34.099609
32.537109

2)
archived database.

basically make new databases right?
database_2003
database_2004 etc? (and delete 2003/2004 data)

3)
distribute your data over multiple file groups. (meta)
The database will be still big/same, right? backups/restore should take same time? will reports be smart to only hit the needed filegroups and hence less IO?

4)
rolling window
yes.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

ste5anSenior Developer
Commented:
3) Yes and no. A full backup will need the same time. But if the data in "older" partitions don't change, then you can do partial backups and restores over file groups.

See also: How to: Back Up Files and Filegroups (Transact-SQL)

The problem with separate databases is that you need to consolidate the data manually (harcoded) by adding views like

SELECT *
FROM database_2003.dbo.tableA
UNION ALL
SELECT *
FROM database_2004.dbo.tableA
UNION ALL -- ..
SELECT *
FROM database_2017.dbo.tableA

Open in new window


Querying a partitioned table uses the partition function to select only the needed partition and is thus faster.
Vitor MontalvãoIT Engineer
Distinguished Expert 2017

Commented:
1.five)
All those 5 tables has at least a date or datetime field?

basically make new databases right?
 database_2003
 database_2004 etc? (and delete 2003/2004 data)
I wanted to suggest only a single database for archiving. You just need to be sure about which old data to be move into archive (data that you're almost sure it won't be accessed anymore).

Author

Commented:
>>All those 5 tables has at least a date or datetime field?
yes; all tables are date-based

>>I wanted to suggest only a single database for archiving.
thanks. Is this in addition to possible to partitioning (partition function as recommended in 42059344)or an alternative solution?

thanks for partial backups idea.

with the 5 tablesize i shared, would you recommend start only with the one 171GB or all 5?
IT Engineer
Distinguished Expert 2017
Commented:
Partitioning or archiving is up to you but I would say that if the old data is keep being accessed regularly then Partitioning should be a better choice. If the old data is really not needed then you can go for an Archive solution.

Author

Commented:
thank you,

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial