MySQL introduced optimizer hints in version 5.7 and greatly
extended the feature in MySQL 8. One thing that has been missing
though is the ability to specify index hints using the syntax of
optimizer hints. This has been improved of in MySQL 8.0.20 with
the introduction of index-level optimizer hints for the
FORCE
and IGNORE
versions of the index
hints. This blog will look at the new index hint syntax.
Warning
Do not add index hints – neither using the old or new style –
unless you really need them. When you add index hints, you limit
the options of the optimizer which can prevent the optimizer
obtaining the optimal query plan as new optimizer improvements
are implemented or the data changes.
On …