第 39 卷 第 2 期2018 年 3 月 內蒙古農業大學學報( 自 然 科 學 版 ) Journal of Inner Mongolia Agricultural University ( Natural Science Edition) Vol. 39 No. 2 Mar. 2018 基于 ORACLE 成本優化器的 SQL 查詢 優化分析與應用* 魏玉芬, 王玥 ( 黑龍江八一農墾大學理學院,大慶 163319) 摘要: SQL 語句是操控和訪問數據庫的唯一語言,因此對 SQL 執行策略的優化,可以縮短響應時間、降低 CPU 使用率、顯著地改善數據庫系統及應用系統的性能。本文通過對 SQL 查詢進行索引優化調整和分區優化調整,優化索引和分區結構,制定優化執行策略,以減少成本輸出,降低 CPU 使用率,減少磁盤 I/O,提高數據庫查詢的執行效率,并利用實例進行優化驗證。 關鍵詞: Oracle 數據庫; Sql; 成本優化器中圖分類號: TP311. 132. 3 文獻標志碼: A 文章編號:1009 -3575( 2018) 02 -0088 -06 DOI:10. 16853/j. cnki. 1009 -3575. 2018. 02. 014 SQL QUERY OPTIMIZATION AND APPLICATIONBASED ON ORACLE COST OPTIMIZER WEI Yufen, WANGYue ( College of Science,Heilongjiang Bayi Argriculture University,Daqing 163319,China) Abstract: SQL statement is manipulating the only language and access database. it can significantly improve the performance of da-tabase system and application system through Optimize SQL execution strategy,shorten response time,reduce the CPU usage. In this article,Using the method of index optimization adjustment and partition optimization for sql,Optimize the structure of index and par-tition,Optimal execution strategy,In order to reduce the cost of the output,reduce the CPU utilization,reduce disk I/O,improve the execution efficiency of database query,and it's optimized by practical example. Keywords: Oracle database; sql; cost - based optimizer 從 Oracle 8i 引入基于成本的優化器 CBO 開始,Oracle 獲取所有執行計劃的相關信息都是通過對這些信息進行計算分析,最后得出一個代價較小的執行計劃作為最終的執行計劃。而傳統的基于規則的優化器 RBO,則是在優化器中嵌入若干個規則,這些規則是由提示(