I'm using Azure SQL DB and noticed that one of my largest databases appears to have a primary key index with a total size of 6Gb. It's a clustered index on a uniqueidentifier
. However, the total rows in the table only amount to around 78k rows at any given point in time.
This table stores outbound email and sms messages, so it fills up and get's emptied out on a regular basis. We also run weekly index maintenance across the database, so I'm trying to understand why this PK index appears to be far larger than it has any reason to be.
The email sizes are almost 50KB in some cases for the HTML ones.
With my own local testing, it seems removing rows from this table does reduce the size of the PK, but this does not appear to be happening on the production database.
And then what options do I have to reduce this index size and free up what I imagine is a lot of unused space.