When MariaDB Server should use optimizer hints
An article by MariaDB Server engineer Oleg Smirnov uses three examples to explain when optimizer hints can correct query plans. In one example, the optimizer estimated that 50 New Zealand customers had 500 orders, while the actual number was 400059; using a join-order hint reduced execution time from 237.9 ms to 13.7 ms. The article also explains how to use hints including INDEX, NO_MERGE, and SEMIJOIN(MATERIALIZATION).
Why it matters: Using reproducible MariaDB Server examples, the article explains how hints can be used to fix join order, index selection, and subquery strategies when the data leads to cardinality misestimates.



