oracle 效能最佳化操作十四: 使用基於函數的索引,oracle效能最佳化

來源:互聯網
上載者:User

oracle 效能最佳化操作十四: 使用基於函數的索引,oracle效能最佳化

前面談到任何對列的操作都可能導致全表掃描,例如:

<span style="font-size:18px;">select * from emp where substr(ename,1,2)=’SM’;</span>

但是這種查詢又經常使用,我們可以建立一個帶有substr函數的基於函數的索引,

<span style="font-size:18px;">create index emp_ename_substr on eemp ( substr(ename,1,2) );</span>

這樣在執行上面的查詢語句時,這個基於函數的索引將排上用場,執行計畫將是(INDEX RANGE SCAN)。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.