3243
MariaDBWARNINGNotableQuery OptimizationHIGH confidence

Index cannot be used for this query

Production Risk

Low — warning only; query proceeds with a full scan instead.

How to reproduce
trigger — this will error
trigger — this will error
SELECT /*+ INDEX(t1 idx_col) */ * FROM t1 WHERE non_indexed_col = 1;

expected output

Warning 3243: Index 'idx_col' is not applicable for query.

Fix

Remove index hint

Remove index hint
SELECT * FROM t1 WHERE non_indexed_col = 1;

Why this works

Let the optimizer choose the best access path without forcing an inapplicable index.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3243 ER_WARN_INDEX_NOT_APPLICABLE2

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors