How to use index in select statement?

前端 未结 8 622
误落风尘
误落风尘 2020-12-12 12:42

Lets say in the employee table, I have created an index(idx_name) on the emp_name column of the table.

Do I need to explicitly specify the index name in

8条回答
  •  眼角桃花
    2020-12-12 13:07

    Generally, when you create an index on a table, database will automatically use that index while searching for data in that table. You don't need to do anything about that.

    However, in MSSQL, you can specify an index hint which can specify that a particular index should be used to execute this query. More information about this can be found here.

    Index hint is also seems to be available for MySQL. Thanks to Tudor Constantine.

提交回复
热议问题