前些天發現了一個巨牛的人工智能學習網站,通俗易懂,風趣幽默,忍不住分享一下給大家。點擊跳轉到教程。
1. 創建聯合索引:
CREATE INDEX idx_xxx_stitution ON xxx_order (status,institution_code)?
idx_xxx_stitution :索引名
xxx_order :表名
status,institution_code:要建索引的多個字段名
2. 查看?
show index from xxx_order?
寫查詢條件時,索引中在前面的字段先查。
或者根據查詢來建聯合索引,就在建立索引時,把先查的字段寫在前面,如本例中的?status 。
3. 存在同名索引時會報錯:Duplicate key name
4. 刪除:?
ALTER ?TABLE ?xxx_order DROP ?INDEX ?idx_xxx_stitution
?