I have a table for user questions and each question has a “question_score” field. for this field, if i allow it to be a NULL then this may save some spaces or even maybe save some CPU times, will it?
question_id (int) | quesion_name (varchar) | question_score (int) …
You won’t save any space or cpu time.
Even if the value is
NULL, MySQL will still have to store this fact.Sometimes, permits
NULLvalue is the right thing to do, but surely not when the reason is some non-existent space optimization. Default value is generally the way to go.