Can I tell mariadb which query plan to use for a given query?
There are al lot of passibilities to force mariadb 

for example: 


Forcing Join Order
Forcing Usage of a Specific Index for the WHERE Clause
USE INDEX: Use a Limited Set of Indexes
IGNORE INDEX: Don't Use a Particular Index
FORCE INDEX: Forcing an Index


how they work and how to use it

https://mariadb.com/kb/en/index-hints-how-to-force-query-plans/