What is the effect of NULL on MySQL tables? (Bshow)

Lately, I have been thinking whether it is worth having 1 table with perhaps a lot of NULL columns or it is better to have more tables without NULL. I heard that NULL is not stored in InnoDB, so I was wondering if there were any flaws or problems with having many rows with lots of NULL. I have always heard that common NULL is bad, but I never found out why. By the way, these will be NULL on foreign keys, if that matters at all.

In the second doubt, is there a performance issue when I use INNER JOIN in columns with lots of NULL? For example, if I have 4 foreign keys and I'm going to make 4 INNER JOINs, but most likely only 1 of them is not NULL, will this affect performance? Thanks

+5
source share
2 answers

Cm:

NULLs are indexed.

In InnoDB, you can reduce storage requirements for your data row using NULL.

+6
source

High Performance MySQL: ", , " , , , , . , , , NULL MySQL , . , , (, ) MyISAM. , , 0 , . NULL NOT NULL, .

+2

All Articles