zoukankan      html  css  js  c++  java
  • [bbk4949]第64集 第7章 数据库的维护 01

    Oracle Optimizer:Overview

    The Oracle optimizer determines the most efficient execution plan and is the most important step in the processing of any SQL statement.

    The Optimizer

    • Evaluates expressions and conditions
    • Uses object and system statistics
    • Decides how to access the data
    • Decides how to join tables
    • Determines the most efficient path

    Optimizer Statistics

    Optimizer statistics are:

    • A snapshot at a point in time
    • Persistent across instance restarts
    • Collected automatically
    SQL> select count(*) from frx_oa_dict;
    
      COUNT(*)
    ----------
           480
    
    SQL> select num_rows from dba_tables
      2  where owner='ARCER' and table_name = 'FRX_OA_DICT';
    
      NUM_ROWS
    ----------
           479

    上述SQL语句说明,优化器的统计数据与实际表中的数据,有可能存在差距的.而oracle判断执行计划的依据则是数据字典中的统计数据.

    每个语句就是一个游标.

    Using the Manage Optimizer Statistics Page

    Gathering Optimizer Statistics Manually

    Preferences(首选项) for Gathering Statistics

  • 相关阅读:
    [leetcode] Valid Sudoku
    [leetcode] Count and Say
    [leetcode] Decode Ways
    [leetcode] Sqrt(x)
    [leetcode] Best Time to Buy and Sell Stock II
    7-27 兔子繁衍问题
    7-26 最大公约数和最小公倍数
    7-25 求奇数和
    7-24 猜数字游戏
    7-23 分段计算居民水费
  • 原文地址:https://www.cnblogs.com/arcer/p/3108016.html
Copyright © 2011-2022 走看看