SQL Index space and unused table space

Hollisorama 381 Reputation points
2021-01-12T17:24:34.027+00:00

I've got a table in a SQL database that has a large unused space that corresponds to the amount of space allocated to indexes

55842-image.png

I was working on this by running a reindex on the specific table, but I'm running into space issues and I'm not sure if my approach is effective.

SQL Server Other
{count} votes

6 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2021-01-13T22:11:08.88+00:00

    If I understand it correctly, unused space refers to entire pages in extents that have been allocated but not used. You could something like this if you bulk load with a small batch size with minimal logging.

    Note that if you have pages that only have one or two rows them, they are entirely included in reserved.

    Since this is a vendor system, I would not do anything without approval of the vendor. If you mess things up, that support case would not be fun.

    But you try the exercise in a copy of the database on a different server. I would also be interested in just dropping an recreating the XML indexes. Not that they may be the culprit, but they are "special" here.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.