patternsqlMinor
Why is the database size larger than sum of table sizes
Viewed 0 times
whythelargersizethandatabasesizessumtable
Problem
I wanted to know why database size is a way greater than thesum of table size in a database? How does it change?
Solution
why database size is a way greater than the sum of table size in a database?
Databases contain lots of other things besides "just" your data.
Indexes are the largest and most obvious. Every Index contains its key values, possibly some other stuff as well, depending on the Index type, and a pointer to the corresponding Data record.
Every Table, and every Row within every Table, has some overhead associated with it, over and above the actual Data that you or I care about.
Then there's all the stuff that the DBMS creates for itself, like statistics tables, entire schemas for metadata, "code" objects like procedures and functions, and many, many more.
Databases contain lots of other things besides "just" your data.
Indexes are the largest and most obvious. Every Index contains its key values, possibly some other stuff as well, depending on the Index type, and a pointer to the corresponding Data record.
Every Table, and every Row within every Table, has some overhead associated with it, over and above the actual Data that you or I care about.
Then there's all the stuff that the DBMS creates for itself, like statistics tables, entire schemas for metadata, "code" objects like procedures and functions, and many, many more.
Context
StackExchange Database Administrators Q#270602, answer score: 3
Revisions (0)
No revisions yet.