I will try to be as simple as I can be
You cannot just make a salary a clustered index , unless you make it unique or primary, which is kind of stupid and pointless because two people can have the same salary.
A MYSQL table can have only one clustered index for each table. By default, the database selects the primary key for the clustered index.
If you do not define a PRIMARY KEY for your table, MySQL finds the first UNIQUE index, where all key columns are NOT NULL and InnoDB uses it as a clustered index.
To speed up your query, I have a few suggestions , go for secondary indexes,
If you want to find the salary by the direct value , then hash indexes are the best option if MYSQL already supports this.
If you want to find a value using more than, less than, or some range, it is better to use B-tree indexes.
The first option is faster than the second, but limited only by the equality operator.
Hope this helps.
source share