August 27, 2016 at 1:27 am
Hi,
I am new to table partitioning.
I have a large table with millions of rows, There is no Date column in the table and i have the primary key column with Identity(1,1). Can i still paritition the table without date column.
Thanks in advance,
Sanjay
August 27, 2016 at 3:40 am
Depends. Why are you partitioning the table?
The purpose behind the partitioning will determine what your partition columns should be.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 27, 2016 at 5:10 am
As already mentioned the data is huge, select or update is taking long time.
August 27, 2016 at 5:32 am
Ok, so if you're after performance improvements, why are you wasting time looking at partitioning?
Partitioning is for data management, fast loads, archiving, that kind of thing, if if you are trying to do that then the way that data is loaded or removed will determine the partition columns
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 27, 2016 at 11:34 am
sanjaydut26 (8/27/2016)
Hi,I am new to table partitioning.
I have a large table with millions of rows, There is no Date column in the table and i have the primary key column with Identity(1,1). Can i still paritition the table without date column.
Thanks in advance,
Sanjay
Just to add a strong second to what Gail wrote...
Partitioning isn't a panacea-of-performance solution. In fact, it will frequently slow queries down because of the extra B-TREEs that it has to slog through for each partition. A well written query (has SARGable predicates that can actually use an index properly) executed against a properly designed, properly indexed monolithic table will usually beat the same query executed against a partitioned table even in the face of so-called "partition elimination".
The greatest irony is that the things that you must do to the table you want to partition (setting up the correct indexes being the most important) is the same thing you need to do to make the queries run faster without partitioning.
To answer your original question, yes, you can partition without a date column but you need some other immutable column to do it with and an IDENTITY column could be used but, unless the older data is completely static so that the indexes don't change on the older partitions allowing you to greatly reduce index maintenance and, possibly, backups (older partitions could be set to READ_ONLY after a final backup), there's no performance advantage to partitioning and could actually cause things to run a bit slower.
Performance is in the code. Concentrate on fixing the code.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 28, 2016 at 3:03 am
Thanks Jeff.:-)
August 28, 2016 at 3:03 am
Thanks, Gail:-)
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply