Have you tried to force the optimizers hand? https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/query-optimizations/force-index