I have a huge database that has several tables that hold several million records. It's holding engineering data for a client and continually grows. This is impacting performance, even with optimised indexing. So I've been looking at partitioning.
However, I would be looking at partitioning on a version held in a table. In it's most simplistic form the table comprises of:-
VersionID int
SheetID int
CreationDate datetime
SomeDate nvarchar(255)
Version int
And the data would look something like:-
1, 1, 2010-09-01, blah, 1
2, 1, 2010-09-02, more blah, 2
3, 1, 2010-09-04, blah, 3
4, 2, 2010-09-02, more blah, 1
For every new change to a 'sheet' in the system, this table has a new entry added with a new version. Ideally I want to partition the table so that I have the top 2 versions for each 'sheet'. So from the table above I'd want versions 2 & 3 for sheet id 2, and version 1 for sheet id 2, with the rest moved to the partition. From what I've read this doesn't seem possible. Am I right or wrong?
If I'm wrong, then following on from this I have a bunch of tables that all link back to this table. These hold the various versions of data entered. Can I partition these based on the partition of the 'main' table, or does the partition have to be specifically based on a column from the table it refers to?
NB I'm not the most au fait SQL developer, so apologies if this is a completely daft question!