[系統] Oracle決定使不使用INDEX
大家好 小弟今天遇到一個非常奇怪的情況
我建立一個新的TABLE 欄位只有一個ID
把rownum放進ID INSERT 五百萬筆資料
也就是TABLE內有ID 1~ ID 5000000
再建立一個INDEX ON ID
接著測試 SELECT ID FROM TABLE WHERE ID=435323
發現執行計劃居然是FULL TABLE SCAN
此時再建立UNIQUE INDEX ON ID
再下一次剛剛的SQL發現執行計劃就走UNIQUE INDEX了
因為這是新的TABLE應該不會有需要analyze的問題..
我覺得這是一個非常基本的情況..不知為何沒使用INDEX?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.65.163.29
→
09/24 22:45, , 1F
09/24 22:45, 1F
→
09/24 22:48, , 2F
09/24 22:48, 2F
→
09/24 22:52, , 3F
09/24 22:52, 3F
→
09/24 22:52, , 4F
09/24 22:52, 4F
→
09/25 22:24, , 5F
09/25 22:24, 5F
→
09/25 22:27, , 6F
09/25 22:27, 6F
→
09/25 22:28, , 7F
09/25 22:28, 7F
→
09/26 16:24, , 8F
09/26 16:24, 8F
→
09/26 16:25, , 9F
09/26 16:25, 9F
→
09/26 16:25, , 10F
09/26 16:25, 10F
→
09/26 16:26, , 11F
09/26 16:26, 11F
→
09/26 17:56, , 12F
09/26 17:56, 12F
→
09/26 17:57, , 13F
09/26 17:57, 13F
→
09/26 17:58, , 14F
09/26 17:58, 14F
→
09/26 17:59, , 15F
09/26 17:59, 15F
→
09/26 17:59, , 16F
09/26 17:59, 16F
→
09/26 18:01, , 17F
09/26 18:01, 17F
→
09/26 18:01, , 18F
09/26 18:01, 18F
→
09/26 18:04, , 19F
09/26 18:04, 19F
→
09/26 18:05, , 20F
09/26 18:05, 20F
→
09/26 18:05, , 21F
09/26 18:05, 21F
→
09/26 18:06, , 22F
09/26 18:06, 22F
→
09/26 18:07, , 23F
09/26 18:07, 23F
→
09/26 18:07, , 24F
09/26 18:07, 24F
→
09/26 18:10, , 25F
09/26 18:10, 25F
→
09/26 18:10, , 26F
09/26 18:10, 26F
→
09/26 18:11, , 27F
09/26 18:11, 27F
→
09/26 18:19, , 28F
09/26 18:19, 28F
Database 近期熱門文章
PTT數位生活區 即時熱門文章
104
216