Indexing for MySQL TINYINT(1)?

Asked 2 years ago, Updated 2 years ago, 32 views

Do I need to give you an index?

mysql

2022-09-21 15:17

1 Answers

Is the column PK? The data type and index are not related to each other.

Of course, if the column has a high distribution, the index may not be meaningful. For example, the gender column of the Korean people will have a 50% distribution, so the index is meaningless.

Perhaps the meaning of the questioner's question is also one digit, so the distribution is high, so isn't it appropriate for an index column? I don't know if it means that. The appropriate distribution plot is usually around 10-15% or so.

It's a one-line question.Please understand that I cannot give you an accurate answer. Also, be aware that good answers come from good questions.


2022-09-21 15:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.