1. 程式人生 > >MySQL部分索引

MySQL部分索引

In SQ row nod let schema username tro emp

部分索引

char/varchar2太長,全部做索引的話,效率低,浪費存儲空間

select avg(length(username)) from

索引統計:

  • show index from table
  • select * from I_S.STATISTICS
  • mysql.innodb_index_stats

MySQL5.7索引利用率:

select index_name,rows_selected,rows_updated,rows_deleted from schema_index_statistics where table_schema=‘scott‘ and table_name=‘emp‘;

查看冗余索引:schema_redundant_indexes

索引隱式轉換:

select * from t1 where user=123; 不會利用user列的索引,首先將user轉換成assic碼

MySQL部分索引