鍍金池/ 問(wèn)答/數(shù)據(jù)庫(kù)/ Mysql: 若組合索引包含NULL值的列則整個(gè)組合索引無(wú)效,是真的嗎?

Mysql: 若組合索引包含NULL值的列則整個(gè)組合索引無(wú)效,是真的嗎?

看到網(wǎng)上說(shuō)法: 在mysql中,若組合索引包含NULL值的列則整個(gè)組合索引無(wú)效

這句話是不是正確的?

回答
編輯回答
尐潴豬

不對(duì),根據(jù)mysql文檔,spatial index不能存null,其他的可以:https://dev.mysql.com/doc/ref...

Index Class Index Type Stores NULL VALUES Permits Multiple NULL Values IS NULL Scan Type IS NOT NULL Scan Type
Primary key BTREE No No N/A N/A
Unique BTREE Yes Yes Index Index
Key BTREE Yes Yes Index Index
FULLTEXT N/A Yes Yes Table Table
SPATIAL N/A No No N/A N/A

2018年6月30日 16:27