看板 Database 關於我們 聯絡資訊
假設有兩個欄位 A B 狀況1: 將兩個欄位獨立個設定為index SQL: select * from table where A = 1 and B = 1 結果: 兩個都會吃到key 偶爾不會 不知道為什麼 狀況2: 將兩個欄位合併設定為index SQL: select * from table where A = 1 and B = 1 結果: 兩個都會吃到KEY 且比上述獨立設定效能要來的快 SQL: select * from table where A = 1 結果: 可以吃到KEY SQL: select * from table where B = 1 結果: 不會吃到KEY -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.217.28.120
mesak:瞭解了,謝謝解說 12/17 23:40
airct:http://ppt.cc/C_!r 02/14 01:16