MariaDB Inner join is slow
Our solution: Set the variable optimizer_search_depth to zero.
The same query now needs 0.3 instead of 13 seconds.

To test it, call before your statement:

set SESSION optimizer_search_depth=0;


To make it permanent put it in the my.conf file and restart the db.