Why does the query plan start with a not-filtered-for table when the filtered-for table's entries exceed a certain threshold?
Perhaps you've noticed the large discrepancy between rows and r_rows for customeritem in the second analysis.  According to MariaDB's manual, that table could use an &quot;analyze&quot; itself.