1. 程式人生 > >(2.8)Mysql之SQL基礎——索引的查詢與刪除

(2.8)Mysql之SQL基礎——索引的查詢與刪除

sele rom db_name name test unique 查詢 img alt

(2.8)Mysql之SQL基礎——索引的查詢與刪除

1、索引查詢

(1)按庫查詢

  select * from information_schema.statistics where table_schema=‘test‘;

(2)按表查詢

  select * from information_schema.statistics where table_schema=‘test‘ and table_name = ‘test103‘;

(3)查詢

  show index from table_name from db_name;

  [1]show index from test102;  [2]show index from test102\G --grid網格  [2]show index from test102 from test;

(4)結果釋義  技術分享圖片

  [1]NON_UNIQUE:不是唯一索引(為1則不是唯一索引,為0則是唯一索引)

  [2]SEQ_IN_INDEX:索引序列,如果大於1,則必定是復合索引

  [3]CARDINALITY:基數,即行數

(2.8)Mysql之SQL基礎——索引的查詢與刪除