MariaDB Inner join is slow Here is my SQL (with explain):

EXPLAIN
SELECT * FROM
GBI gbi
INNER JOIN VF_KRED kred ON
    gbi.vendor = kred.vendor;


Giving below the outcome:



Now, the select SQL takes ~10 seconds to produce the outcome.

Below are the indexes on tables:


VF_KRED table:





GBI table:




Any clues?
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.