Sunday, 1 September 2013

Can I cluster a SQL SERVER 2012 table on a column that's not the primary key?

Can I cluster a SQL SERVER 2012 table on a column that's not the primary key?

I have a table that looks like this:
CREATE TABLE Content (
[ContentId] INT IDENTITY (1, 1) NOT NULL,
[Title] NVARCHAR (50) Not NULL,
CONSTRAINT [PK_Content] PRIMARY KEY CLUSTERED ([ContentId] ASC)
)";
CREATE NONCLUSTERED UNIQUE INDEX Content_Subject_IX On Content (Title)
I understand that it's best to have the primary key as an identity key and
to have the table clustered on that (is that correct) ?
However for performance reasons I want to have a very fast access of the
table with something like a
SELECT FROM CONTENT WHERE TITLE = "overview"
Can I have my primary key as ContentId and still cluster the table on
Title for the fastest access?

No comments:

Post a Comment