Problems with unique indexes and null

The

unique index allows the field to be null, but does the null value of the field invalidate the index? What"s the point of having a unique index with null values?

Mar.21,2021

your understanding of index invalidation is not quite right, for example, column an is indexed, so when the an is null condition is applied to this column, the index is not used (it does not mean that the index is invalid), but when you use the index.' You can use the index.

to put it simply: single-column indexes do not store null values, and composite indexes do not store all null values

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea8c23-1f00.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea8c23-1f00.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?