




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【正版授权】 IEC 63297:2025 EN-FR Sensing devices for non-intrusive load monitoring (NILM) systems
- 【正版授权】 IEC 63119-1:2025 EN Information exchange for electric vehicle charging roaming service - Part 1: General
- 华科版五年级信息技术课件
- 海南省小升初数学试卷
- 怀化市高三联考数学试卷
- 济南初三中考数学试卷
- 健康管理学概论课件
- 2024-2030年中国浙江省房地产行业市场调查研究及投资前景展望报告
- 中国香熏炉行业市场发展前景及发展趋势与投资战略研究报告(2024-2030)
- 中国榉木行业市场发展前景及发展趋势与投资战略研究报告(2024-2030)
- 2025年项目管理专业资格考试试题及答案
- 非公企业党建培训课件
- 2025区域型变电站智能巡视系统技术规范
- 汛期公交安全课件
- 环境影响管理方案(3篇)
- 财务报表编制与审核合同模板
- 上海闵行区教育系统招聘实验员考试真题2024
- 建设部建设工程重大质量安全事故应急预案
- 2025年中航油招聘笔试参考题库附带答案详解
- 2024年中国中高端电子铝箔行业市场调查报告
- DB54∕T 0275-2023 民用建筑节能技术标准
评论
0/150
提交评论