2024 Jun 03 10:59 AM - edited 2024 Jun 03 11:03 AM
We have an use-case to show table level space metrics. We came across 'sp_spaceused' and want to understand the metrics it shows like reserved, data, unused and index size.
The info doc says "The amount of space allocated (reserved) reported by sp_spaceused is a total of the data, index size, and available (unused) space."
But when trying it out, it is not the case (screenshot below for reference).
Am I missing something here?
Request clarification before answering.
Without any details I'm guessing the difference is related to oam pages which could be part of a reserved extent but not usable for table/index storage.
If you want to dig into the details I'd recommend you run select spaceusage(db_id(),object_id('<table_name>') and then reference these values as you step through the source code for sp_spaceused to understand its output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.