Sql-server – SQL Server Table Index To big

indexsql server

I have a table that has approximately 450k records
here is the structure of it

CREATE TABLE [dbo].[Reviews](
[ReviewID] [int] IDENTITY(1,1) NOT NULL,
[AuthorName] [nvarchar](50) NULL,
[AuthorURL] [nvarchar](500) NULL,
[Rating] [int] NULL,
[Comment] [nvarchar](max) NULL,
[UTCCreatedDate] [date] NULL,
[IsImported] [bit] NULL,
[ListingID] [int] NULL,
CONSTRAINT [PK_Reviews] PRIMARY KEY CLUSTERED 
(
[ReviewID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

ALTER TABLE [dbo].[Reviews]  WITH NOCHECK ADD  CONSTRAINT [FK_Reviews_Listings] FOREIGN KEY([ListingID])
REFERENCES [dbo].[Listings] ([ListingID])
GO

ALTER TABLE [dbo].[Reviews] CHECK CONSTRAINT [FK_Reviews_Listings]
GO

Now when I look at the index sizes of all my tables (via posted tsql) here http://basitaalishan.com/2012/07/06/find-the-size-of-index-in-sql-server/

The review table has a massive 446264K (approximately 450MB) index on just the primary key.

What are my options on reducing/eliminating this as I am not sure how useful this is as this is just a related table (child)

Best Answer

Your problem is not the primary key. It is a misunderstanding of what a clustered index is. If you look at your structure you will see that the primary key is clustered. This is the default and fairly normal but is not always the case so it pays to check.

The clustered index is basically the table itself. The data pages of the clustered index are the data pages of the table. So your 450mb for the primary key is mostly the data of the table itself. At 446264K that makes it about 1k per row which is not unreasonable depending on the amount of data in the AuthorURL and Comment columns.