I have a table of 500 million rows on SQLServer 2016. I calculate that each row should take up 12 bytes, total size should be in the order of 6GiB. However the actual size is over 10 GiB.
After ruing dbcc showcontig ('[Table]') with tableresults I see the the MinimumRecordSize and MaximumRecordSize is 19 bytes and the AverageFreeBytes is 11.023 bytes.
The table is defined as the following.
CREATE TABLE [dbo].[Table](
[Key] [binary](7) NOT NULL,
[Value] [binary](5) NOT NULL
) ON [PRIMARY]
CREATE UNIQUE CLUSTERED INDEX [ClusteredIndex-Key] ON [dbo].[Table]
(
[Key] ASC
) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
My question is where is the extra 7 bytes per row coming from? And is there anything I can do about it?
Also if there are any suggestions about space optimizations would also be appreciated, the table will be readonly (no updates or inserts).
برچسب: oracle actual row size,sql actual row size,sql server actual row size,sql server calculate actual row size,
نویسنده: رضا رضوی