Get the App
SLTechnology News&Howtos  ›  Database  › 

MySQL index hints usage

Shulou Source: shulou.com Published: 2022-06-01 04:44:49 10月05日 Update

Index hints can artificially tell the mysql optimizer how to complete select, such as forcing certain index (s) to go or ignoring certain index (s).

The specified index must have an index name.

Officially provided basic grammar:

index_hint:

USE {INDEX|KEY}

[FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])

| IGNORE {INDEX|KEY}

[FOR {JOIN|ORDER BY|GROUP BY}] (index_list)

| FORCE {INDEX|KEY}

[FOR {JOIN|ORDER BY|GROUP BY}] (index_list)

where index_list is the index name.

Test table:

Author Weixin Official Accounts (continuously updated)

Tags: Index author Public Foundation official Grammar mandatory Update Test Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Information NVidia Docker Apple