版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Managing IndexesObjectivesAfter completing this lesson, you should be able to do the following:List the different types of indexes and their usesCreate various types of indexesReorganize indexesDrop indexesGet index information from the data dictionaryMonitor the usage of an indexClassification of I
2、ndexesLogicalSingle column or concatenatedUnique or nonuniqueFunction-basedDomainPhysicalPartitioned or nonpartitioned B-treeNormal or reverse keyBitmapB-Tree IndexIndex entry headerKey column lengthKey column valueROWIDRootBranchLeafIndex entryBitmap IndexkeystartROWIDendROWID bitmapTableIndexBlock
3、 10Block 11Block 12File 3Comparing B-Tree and Bitmap IndexesB-treeSuitable for high-cardinality columnsUpdates on keys relativelyinexpensiveInefficient for queries using OR predicatesUseful for OLTPBitmapSuitable for low-cardinality columns Updates to key columns veryexpensiveEfficient for queries u
4、sing OR predicatesUseful for data warehousingCreating Normal B-Tree IndexesCREATE INDEX hr.employees_last_name_idxON hr.employees(last_name)PCTFREE 30STORAGE(INITIAL 200K NEXT 200KPCTINCREASE 0 MAXEXTENTS 50)TABLESPACE indx;Creating Indexes: GuidelinesBalance query and DML needsPlace in separate tab
5、lespaceUse uniform extent sizes: Multiples of five blocks or MINIMUM EXTENT size for tablespaceConsider NOLOGGING for large indexesINITRANS should generally be higher on indexes than on the corresponding tables.Creating Bitmap IndexesUse the parameter CREATE_BITMAP_AREA_SIZE to specify the amount of
6、 memory allocated for bitmap creation.CREATE BITMAP INDEX orders_region_id_idxON orders(region_id)PCTFREE 30STORAGE(INITIAL 200K NEXT 200KPCTINCREASE 0 MAXEXTENTS 50)TABLESPACE indx;Changing Storage Parameters for IndexesALTER INDEX employees_last_name_idxSTORAGE(NEXT 400KMAXEXTENTS 100);Allocating
7、and Deallocating Index SpaceALTER INDEX orders_region_id_idxALLOCATE EXTENT (SIZE 200KDATAFILE /DISK6/indx01.dbf);ALTER INDEX orders_id_idxDEALLOCATE UNUSED;Rebuilding Indexes Use the ALTER INDEX command to:Move an index to a different tablespaceImprove space utilization by removing deleted entriesC
8、hange a reverse key index to a normal B-tree index and vice versaALTER INDEX orders_region_id_idx REBUILDTABLESPACE indx02;Online Rebuild of IndexesRebuilding indexes can be done with minimal table lockingSome restrictions still applyALTER INDEX orders_id_idx REBUILD ONLINE;Coalescing IndexesBefore
9、coalescingAfter coalescingALTER INDEX orders_id_idx COALESCE;Checking Index Validity ANALYZE INDEX orders_region_id_idxVALIDATE STRUCTURE;INDEX_STATSDropping IndexesDrop and re-create an index before bulk loads. Drop indexes that are infrequently needed and build them when necessary.Drop and re-crea
10、te invalid indexes.DROP INDEX hr.deptartments_name_idx;Identifying Unused IndexesTo start monitoring the usage of an indexTo stop monitoring the usage of an indexALTER INDEX summit.orders_id_idx MONITORING USAGEALTER INDEX summit.orders_id_idx NOMONITORING USAGEObtaining Index InformationInformation
11、 about indexes can be obtained by querying the data dictionary.DBA_INDEXES: Provides information on the indexesDBA_IND_COLUMNS: Provides information on the columns indexedDBA_IND_EXPRESSIONS: Provides information on function based indexesV$OBJECT_USAGE: Provides information on the usage of an indexSummaryIn this lesson, you should have learned how to:Create different types of indexesReorganize indexesDrop indexesGet index information from the data dictionaryBegin and end monitoring usage of ind
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025版住宅小区物业合同转让及社区养老服务协议3篇
- 2025年度二零二五林业苗木培育及采购合作协议4篇
- 二零二五版租赁房屋租赁合同网络安全保障协议3篇
- 二零二五年顶楼住宅买卖合同协议6篇
- 2025版绿色生态园区绿化养护工程承包合同3篇
- 二零二五年度智慧停车设施运营服务合同4篇
- 个人二手家具买卖合同2024年度交易规范3篇
- 枣庄建筑公司2025年度碎石采购合同2篇
- 二零二五版二手房装修改造合同范本
- 2024酒店蔬菜供货合同
- GB/T 45120-2024道路车辆48 V供电电压电气要求及试验
- 财务报销流程培训课程
- 24年追觅在线测评28题及答案
- 春节慰问困难职工方案春节慰问困难职工活动
- 2024年全国职业院校技能大赛高职组(药学技能赛项)考试题库(含答案)
- 2024至2030年中国氢氧化钙行业市场全景调查及发展趋势分析报告
- 鱼菜共生课件
- 《陆上风电场工程概算定额》NBT 31010-2019
- 初中物理八年级下册《动能和势能》教学课件
- 心肌梗死诊疗指南
- 原油脱硫技术
评论
0/150
提交评论