I have a MySQL table where an indexed INT
column is going to be 0 for 90% of the rows. If I change those rows to use NULL
instead of 0, will they b
Just to bring more information to this topic. Take a look what kind of storage engine your table is using first.
You can add an index on a column that can have NULL values if you are using the MyISAM, InnoDB, or MEMORY storage engine. Otherwise, you must declare an indexed column NOT NULL, and you cannot insert NULL into the column.
https://dev.mysql.com/doc/refman/8.0/en/problems-with-null.html