mariadb query optimizer tuning

Change-Id: I2c8e31cb3bc1bcdf6d2d2e654f6cbdb889d34e2a
Merge "mariadb query optimizer tuning" into production