10

I was wondering how much memory does a null value occupy in a database can anyone answer clearly?

9
  • 1
    Depends on the database - IE SQL Server: weblogs.sqlteam.com/mladenp/archive/2007/09/06/…
    – OMG Ponies
    May 3, 2011 at 4:42
  • 2
    @marc_s: you're completely wrong ;-)
    – zerkms
    May 3, 2011 at 4:43
  • 2
    @zerkms I'm pretty sure marc_s was making a joke. May 3, 2011 at 4:47
  • 2
    I highly suggest reasking this question on dba.stackexchange.com
    – jcolebrand
    May 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. May 3, 2011 at 4:51

1 Answer 1

5

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.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.