Saving Original Statistics and Gathering New Statistics
Assume many modifications have been made to the employees table since the last time statistics were gathered. To ensure that the cost-based optimizer is still picking the best plan, statistics should be gathered once again; however, the user is concerned that new statistics will cause the optimizer to choose bad plans when the current ones are acceptable. The user can do the following:
BEGIN DBMS_STATS.CREATE_STAT_TABLE ('hr', 'savestats'); DBMS_STATS.GATHER_TABLE_STATS ('hr', 'employees', stattab => 'savestats'); END;
This operation gathers new statistics on the employees table, but first saves the original statistics in a user statistics table: hr.savestats.
If the user believes that the new statistics are causing the optimizer to generate poor plans, then the original statistics can be restored as follows:
BEGIN DBMS_STATS.DELETE_TABLE_STATS ('hr', 'employees'); DBMS_STATS.IMPORT_TABLE_STATS ('hr', 'employees', stattab => 'savestats'); END;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27036311/viewspace-751068/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Database StatisticsDatabase
- DELETE STATISTICSdelete
- Statistics related viewView
- Time Model Statistics
- oracle之StatisticsOracle
- Import parameter: STATISTICSImport
- How restore CBO statisticsREST
- Oracle Column Group StatisticsOracle
- Explain for the Statistics of Execution PlanAI
- [PT]Column Histogram StatisticsHistogram
- SciTech-Statistics-英語授課:Business Statistics商務統計
- MySQL中的Statistics等待MySql
- AWR中的SQL StatisticsSQL
- statistics的export與import!ExportImport
- How to gather statistics on Oracle eBS.Oracle
- [筆記]statistics資訊的收集筆記
- ORA-38029: object statistics are lockedObject
- PGA memory statistics associated view (103)View
- Oracle 12C Statistics on Column GroupsOracle
- 11g新特性:Pending Statistics
- Fixed Objects Statistics統計資訊收集 - 2Object
- EXP-00091: Exporting questionable statisticsExport
- perl Statistics::Descriptive Perl 的統計模組
- EXP-00091 Exporting questionable statisticsExport
- Wait statistics, or please tell me where it hurtsAI
- 11g新特性--pending statistics
- IBM SPSS Statistics 26中文啟用資源+IBM SPSS Statistics 26補丁安裝教程IBMSPSS
- statistics_level與SGA_TARGET衝突
- 0427建立Extended Statistics函式索引問題函式索引
- 0429建立Extended Statistics函式索引問題函式索引
- EXP-00091: Exporting questionable statistics.Export
- ORA-20005: object statistics are lockedObject
- Oracle TIMED_STATISTICS 引數 說明Oracle
- World Of Statistics:中國人買iPhone 14要花12%年薪iPhone
- Disable the automatic funciton of collecting statistics in 10G
- v$segment_statistics_monitor段的使用情況
- EXP-00091 Exporting questionable statistics錯誤Export
- 關於資料庫 statistics_level的介紹資料庫