Oracle英文版培训课件之SQL Tuning:Les11_RW

上传人:努力****83 文档编号:190630090 上传时间:2023-02-28 格式:PPT 页数:16 大小:285.50KB
返回 下载 相关 举报
Oracle英文版培训课件之SQL Tuning:Les11_RW_第1页
第1页 / 共16页
Oracle英文版培训课件之SQL Tuning:Les11_RW_第2页
第2页 / 共16页
Oracle英文版培训课件之SQL Tuning:Les11_RW_第3页
第3页 / 共16页
点击查看更多>>
资源描述
Index UsageObjectivesAfter completing this lesson,you should be able to do the following:Identify index typesIdentify basic access methodsMonitor index usageIndexing GuidelinesYou should create indexes only as needed.Creating an index to tune a specific statement could affect other statements.It is best to drop unused indexes.EXPLAIN PLAN can be used to determine if an index is being used by the optimizer.Types of IndexesUnique and nonunique indexesComposite indexesIndex storage techniques:B*-tree Normal Reverse key Descending Function based Bitmap Domain indexes Key compressionFull Notes OnlyWhen to IndexIndexDo Not IndexKeys frequently used in search or query expressionsKeys and expressions with few distinct values except bitmap indexes in data warehousingKeys used to join tablesFrequently updated columnsHigh-selectivity keysColumns used only withfunctions or expressions unless creating function-based indexesForeign keysColumns based only on queryperformance Full Notes OnlyEffect of DML Operations on IndexesInserts result in the insertion of an index entry in the appropriate block.(Block splits might occur.)Delete rows result in a deletion of the index entry.(Empty blocks become available.)Updates to the key columns result in a logical delete and an insert to the index.Indexes and ConstraintsThe Oracle Server implicitly creates or uses B*-tree indexes when you define the following:Primary key constraintsUnique key constraintsCREATE TABLE new_channels(channel_id CHAR(1)CONSTRAINT channels_channel_id_pk PRIMARY KEY ,channel_desc VARCHAR2(20)CONSTRAINT channels_channel_desc_nn NOT NULL ,channel_class VARCHAR2(20),channel_total VARCHAR2(13);Indexes and Foreign KeysIndexes are not created automatically.There are locking implications to DML activity on parent-child tables.CUSTOMERS#cust_idSALESPRODUCTS#prod_idCHANNELS#channel_idBasic Access MethodsFull table scans:Can use multiblock I/O Can be parallelizedIndex scans:Allow index access only Are followed by access by ROWIDFast-full index scans:Can use multiblock I/O Can be parallelizedIdentifying Unused IndexesThe Oracle Database provides the capability to gather statistics about the usage of an index.Benefits include:Space conservation Improved performance by eliminating unnecessary overhead during DML operationsEnabling and Disabling the Monitoring of Index UsageTo start monitoring the usage of an index:To stop monitoring the usage of an index:V$OBJECT_USAGE contains information about the usage of an index.ALTER INDEX customers_pk MONITORING USAGE;ALTER INDEX customers_pk NOMONITORING USAGE;Index Tuning Using the SQL Access AdvisorThe SQL Access Advisor:Determines which indexes are requiredRecommends a set of indexes Is invoked from Advisor Central in Oracle Enterprise Manager Run through the DBMS_ADVISOR package APIsUses a workload such as:Current contents of the SQL cache A user-defined set of SQL statements A SQL Tuning Set Hypothetical workloadGenerates a set of recommendations Provides an implementation script SummaryIn this lesson,you should have learned about the following:Indexes Index types DML operations and indexes Indexes and constraintsMonitoring indexes Index usage monitoring
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 课件教案


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!