Home > database >  (MySQL) would you please tell me why the query didn't leave the index?
(MySQL) would you please tell me why the query didn't leave the index?

Time:12-20

 with t1 as (
Select distinct val_2
The from big_table
Where val_3=185
)
Select avg (val_1)
The from aux_table a
Where val_3 in (select val_2 from t1);


Aux_table and big_table are being big table, big_table table has index (val_2 val_3)
Aux_table on val_3 created index in the table, but check the execution plan and found no index, force index is also useless,,,,
Have any bosses know why

  • Related