oracle 效能最佳化操作二:避免不必要的類型轉換,oracle效能最佳化

來源:互聯網
上載者:User

oracle 效能最佳化操作二:避免不必要的類型轉換,oracle效能最佳化

需要注意的是,盡量避免潛在的資料類型轉換。

如將字元型資料與數值型資料比較,ORACLE會自動將字元型用to_number()函數進行轉換,從而導致全表掃描。

例2:表tab1中的列col1是字元型(char),則以下語句存在類型轉換:

<span style="font-size:18px;">select col1,col2 from tab1 where col1>10;</span>

應該寫為:

<span style="font-size:18px;">select col1,col2 from tab1 where col1>'10';</span>

相關文章

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.