How to do it...

You can control the optimizer either by passing hints to the query or by adjusting the variable at a global or session level. You can even adjust the cost of the operations. It is recommended to leave these values as default unless you know what you are doing.

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.