官方文档: https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html
<>以前create table  t1 ( ,小姐:int, ,j int, ,k int, ,index i_idx (i),看不见 ),engine =, innodb; create index  j_idx 提醒t1 (j),看不见的; alter table  t1 add index  k_idx (k),看不见的;
<>以前alter table  t1 alter index i_idx 看不见; alter table  t1 alter index  i_idx 可见;
<>以前祝辞select index_name is_visible →得到information_schema.statistics →,where table_schema =, & # 39; abce& # 39;,以及table_name =, & # 39; t1 # 39;; + - - - - - - - - - - - - - - - - - - - - - - - - + | |,INDEX_NAME IS_VISIBLE | + - - - - - - - - - - - - - - - - - - - - - - - - + |,i_idx ,,,,, |, NO ,,,,,,, | + - - - - - - - - - - - - - - - - - - - - - - - - + 1,row set 拷贝;(0.00,sec) 祝辞show index 得到t1; + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + | |,Table Non_unique |, Key_name |, Seq_in_index |, Column_name |, Collation |, Cardinality |, Sub_part |, Packed |, Null |, Index_type |, Comment |, Index_comment |, Visible | Expression | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + |,t1 ,,, |,,,,,,,,,, 1, |, i_idx ,,, |,,,,,,,,,,,, 1, |,小姐:,,,,,,,,,,|,A ,,,,,,,, |,,,,,,,,,,, 0, |,,,,, NULL |,,, NULL |, YES , |, BTREE ,,,,, |,,,,,,,,, |,,,,,,,,,,,,,,, |, NO ,,,,, |, NULL ,,,,, | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + 1,row set 拷贝;(0.00,sec)
<>以前mysql> show  variables like & # 39; % optimizer_switch % & # 39; index_merge_union index_merge=,=, index_merge_sort_union=, index_merge_intersection=, engine_condition_pushdown=, index_condition_pushdown=, mrr=, mrr_cost_based=, block_nested_loop=, batched_key_access=,实体化=,semijoin=, loosescan=, firstmatch=, duplicateweedout=, subquery_materialization_cost_based=, use_index_extensions=, condition_fanout_filter=, derived_merge=, use_invisible_indexes=, skip_scan=提醒| 返回行数:[1],耗时:14,女士