简体   繁体   中英

Nulls in InnoDBs clustered index?

Using InnoDB in MySQL, I want to speed up selects by utilizing the clustered index better, thus including more frequently used columns in the primary key.

But some frequent columns used are allowed to be null (and some times are). Is there any way to include these in the clustered index (and allow them to be null)?

If not, are there some workarounds or is there some other way to do something similar?

Normalizing the table to exclude the nullable field would work in this case (as commented by Battle_707).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM