I was wondering how much memory does a null value occupy in a database can anyone answer clearly?
-
1Depends on the database - IE SQL Server: weblogs.sqlteam.com/mladenp/archive/2007/09/06/…– OMG PoniesMay 3, 2011 at 4:42
-
2@marc_s: you're completely wrong ;-)– zerkmsMay 3, 2011 at 4:43
-
2@zerkms I'm pretty sure marc_s was making a joke.– Conrad FrixMay 3, 2011 at 4:47
-
2I highly suggest reasking this question on dba.stackexchange.com– jcolebrandMay 3, 2011 at 4:47
-
1@Conard Frix No theoritically marc_s may be wrong but practically he is right how database knows whether an entry is null it should have something like flag to say its a null.– satheesh.droidMay 3, 2011 at 4:51
1 Answer
How much space it takes up depends on what the column is defined to be and on the storage engine being used. Some data types take a fixed amount of space regardless of the data stored. There is a small space penalty for declaring a column to accept NULL. Details can be found in this general discussion in the manual and more in the docs about each storage engine.