Your queries are
using more than two tables
using indexes that have lot of identical values.
using ranges that cover more than 10% of a table.
WHERE key between 1 and 1000 -- Table has values 1-2000
using complex queries where not all used columns are or can be indexed.
In which case you may need to depend on selectivity to get the right plan.
mixing different storage engines.
Like using tables from both InnoDB and Memory in the same query.
using FORCE INDEX to force an index
getting worse (or not good enough) when using ANALYZE TABLE.
depending on --optimizer-use-condition-selectivity > 1 (using selectivity to find out how many accepted rows there are in a table).
using lots of derived tables (subselects).
using ORDER BY / GROUP BY that could be resolved via indexes
using table scans when it should use keys and vice versa.
mariadb가 nasdaq 상장후 계속 적자를 내면서도, 개발을 꾸준히 하면서, 11부터 Query와 innodb를 크게 개선
https://monty-says.blogspot.com/2022/12/i-want-to-wish-you-happy-new-year-with.html