SlideShare a Scribd company logo
Sydney Oracle Meetup - Indexes Paul Guerin OCP Meetup presenter 4 times in past 10 months Development/Production DBA at Origin Energy for past 3.5 years Previous employers: Bluescope Steel (Wollongong), BHP Billiton (Wollongong) 2010 Oxfam Trailwalker: Origin Trail Breakers http://www2.oxfam.org.au/trailwalker/Sydney/team/67 Includes photos from Heysen trail and Flinders rangers….
Indexes - general An index is an optional structure, that can sometimes speed data access. Indexes are also used with integrity constraints. eg unique key, primary key Table rows in which all key columns are null are not indexed , except for bitmap indexes or when the cluster key column value is null. Can place partitioned (local, global) or non-partitioned indexes on a partitioned table. Can place partitioned (global) or non-partitioned indexes on a non-partitioned table.
Cluster Factor The clustering factor is useful as a rough measure of the number of I/Os required to  read an entire table by an index range scan . Compare the cluster factor with a FTS (ie the HWM for a table). Lower the ratio the better (best ratio=1). select index_name, clustering_factor, clustering_factor/blocks from dba_tables a, dba_indexes b where a.owner=b.table_owner and a.table_name=b.table_name and a.owner=upper('&own') and a.table_name=upper('&tbl') order by 3; INDEX_NAME  CLUSTERING_FACTOR CLUSTERING_FACTOR/BLOCKS ----------------- ----------------- ------------------------ CNT$BLT  4320  3.4887097 CNT$CNT_SCN  7682  6.1916129 CNT$CNTNM  23360  18.8387097 CNT$PK_CNTID  49939  40.2733871 CNT$DLNMBR  55664  44.8903226 In many situations the cluster factor can be disregarded.
Usable or unusable Not maintained by DML operations and is ignored by the optimizer. Instead of dropping an index and later re-creating it, you can make the index unusable and then rebuild it. Beginning with Oracle Database 11g Release 2, when you make an existing index unusable, its index segment is dropped. CREATE INDEX myemp_ename ON emp(ename) TABLESPACE users UNUSABLE; Note: Truncating a table makes an unusable index usable.
Visible or invisible An invisible index is maintained by DML operations, but is not used by the CBO. Used to test the removal of an index before dropping it. ALTER INDEX index INVISIBLE; ALTER INDEX index VISIBLE;
Monitoring Index Usage A means of monitoring indexes to determine whether they are being used. If an index is not being used, then it can be dropped. -- start monitoring an index ALTER INDEX <index> MONITORING USAGE; -- stop monitoring an index ALTER INDEX <index> NOMONITORING USAGE; The view V$OBJECT_USAGE can be queried for the index being monitored to see if the index has been used. select * from V$OBJECT_USAGE where table_name=‘<table>'; Note1: Need to login as the owner of the index. Note2: Doesn’t monitor usage for the child index on a foreign key when the parent primary/unique key is modified. Note3: Monitors other accesses eg gather stats, and explain plan.
Monitoring Space Use of Indexes Monitor index efficiency of space usage by analysing, then querying: /* Prevents DML by default so add the ONLINE clause */ analyze index <schema>.<index> validate structure online; SELECT PCT_USED FROM INDEX_STATS; SELECT PCT_USED FROM INDEX_HISTOGRAM;
Rebuild or Coalesce When rebuilding, querying is allowed but DDL is not. Unless you use the ONLINE clause DML is not allowed either. /* performance improvement with NOLOGGING clause */ /* Don’t lock the table with the ONLINE clause */ ALTER INDEX <schema.name> REBUILD NOLOGGING ONLINE; Start online index builds when DML activity is low. Parallel execution is not supported when creating or rebuilding an index online. /* Coalese also available - don’t need twice the index space */ ALTER INDEX <schema.name> COALESCE; ALTER INDEX ... SHRINK SPACE COMPACT;
B-tree indexes Short for  balanced tree , and are the most common type of index. Excellent retrieval performance for a wide range of queries, including exact match and range searches. Descending index: Descending indexes are useful when a query sorts some columns ascending and others descending. Database can use this index to retrieve the data and avoid the extra step of sorting it in descending order.
B-tree indexes Reverse Key: Bytes of the index key are reversed, so inserts are spread over many index blocks. Reversing the key solves the problem of contention for leaf blocks in the right side of a B-tree index.  This problem can be especially acute in an Oracle Real Application Clusters (Oracle RAC) database in which multiple instances repeatedly modify the same block. Index range scanning is limited because not sorted by key column. Note: As inserts are distributed across the index - cluster factor becomes much worse.
B-tree indexes Key compression: ANALYZE INDEX <schema.name> VALIDATE STRUCTURE; SELECT name, partition_name, blocks, opt_cmpr_count, opt_cmpr_pctsave FROM INDEX_STATS; CREATE INDEX  emp_ename ON emp(ename) COMPRESS 1; SELECT compress, prefix_length FROM dba_indexes WHERE owner=‘<owner>’ and table_name = ‘<table>’; Example: non-compressed index: online,0,AAAPvCAAFAAAAFaAAa online,0,AAAPvCAAFAAAAFaAAg online,0,AAAPvCAAFAAAAFaAAl online,2,AAAPvCAAFAAAAFaAAm online,3,AAAPvCAAFAAAAFaAAq online,3,AAAPvCAAFAAAAFaAAt
B-tree indexes compressed index (specified prefix length 1): online 0,AAAPvCAAFAAAAFaAAa 0,AAAPvCAAFAAAAFaAAg 0,AAAPvCAAFAAAAFaAAl 2,AAAPvCAAFAAAAFaAAm 3,AAAPvCAAFAAAAFaAAq 3,AAAPvCAAFAAAAFaAAt compressed index (default prefix – not always optimal): online,0 AAAPvCAAFAAAAFaAAa AAAPvCAAFAAAAFaAAg AAAPvCAAFAAAAFaAAl online,2 AAAPvCAAFAAAAFaAAm online,3 AAAPvCAAFAAAAFaAAq AAAPvCAAFAAAAFaAAt
Index Organised Tables (IOTs) The data is stored inside the index. There is no table. Rows are stored in an index defined on the primary key for the table. (in a normal table, inserts are where ever they can fit). Index-organized tables provide faster key-based access to table data for queries that involve exact match or range search or both. The presence of non-key columns of a row in the leaf block avoids an additional data block I/O.
Index Organised Tables (IOTs) A secondary index is an index on an index-organized table. In a sense, it is an index on an index. The secondary index is an independent schema object and is stored separately from the index-organized table. Secondary indexes provide fast and efficient access to index-organized tables using columns that are neither the primary key nor a prefix of the primary key. A secondary index on an index-organized table can be a bitmap index.
Bitmap indexes In a bitmap index, the database stores a bitmap for each index key. (In a B-tree index, one index entry points to a single row.) In a bitmap index, each index key stores pointers to multiple rows. Useful when: The indexed columns have low cardinality, that is, the number of distinct values is small compared to the number of table rows. The indexed table is either read-only or not subject to significant modification by DML statements. The WHERE clause contains multiple predicates on low- or medium-cardinality columns. The individual predicates on these low- or medium-cardinality columns select a large number of rows. The bitmap indexes used in the queries have been created on some or all of these low- or medium-cardinality columns. The tables in the queries contain many rows.
Bitmap indexes Bitmap indexes can include keys that consist entirely of null values, unlike B-tree indexes. Conceptually, an index leaf contains entries as follows: index key, low rowid and high rowid, a bitmap for those rowids. Shipping Clerk,AAAPzRAAFAAAABSABQ,AAAPzRAAFAAAABSABZ,0010000100 Shipping Clerk,AAAPzRAAFAAAABSABa,AAAPzRAAFAAAABSABh,010010 Stock Clerk,AAAPzRAAFAAAABSAAa,AAAPzRAAFAAAABSAAc,1001001100 Stock Clerk,AAAPzRAAFAAAABSAAd,AAAPzRAAFAAAABSAAt,0101001001 Stock Clerk,AAAPzRAAFAAAABSAAu,AAAPzRAAFAAAABSABz,100001 If the indexed column in a single row is updated, then the database locks the index key entry and not the individual bit mapped to the updated row. Because a key points to many rows, DML on indexed data typically locks all of these rows. For this reason, bitmap indexes are not appropriate for many OLTP applications.
Bitmap join indexes A bitmap join index is a bitmap index for the join of two or more tables. In a bitmap index, an index entry uses a bitmap to point to multiple rows. In contrast, a B-tree index entry points to a single row. For each value in a table column, the index stores the rowid of the corresponding row in the indexed table.
Bitmap join indexes CREATE BITMAP INDEX employees_bm_idx  ON  employees (jobs.job_title)  FROM  employees, jobs WHERE  employees.job_id = jobs.job_id; SELECT COUNT(*)  FROM  employees, jobs  WHERE  employees.job_id = jobs.job_id  AND  jobs.job_title = 'Accountant'; Bitmap join indexes are sometimes much more efficient in storage than materialized join views.
Function-based indexes Include columns that are either transformed by a function, or within an expression. Can be B-tree or bitmap. The database only uses the function-based index when the function is included in a query. CREATE INDEX emp_total_sal_idx ON employees ( 12 * salary * commission_pct , salary, commission_pct); SELECT employee_id, last_name, first_name, 12*salary*commission_pct AS &quot;ANNUAL SAL&quot; FROM  employees WHERE  (12 * salary * commission_pct)  < 30000 ORDER BY &quot;ANNUAL SAL&quot; DESC; A function-based index is also useful for indexing only specific rows in a table. eg Index only the A rows: CREATE INDEX cust_valid_idx ON customers ( CASE cust_valid WHEN 'A' THEN 'A' END );
B-tree cluster indexes This type of index is used to index a table cluster key. Instead of pointing to a row, the key points to the block that contains rows related to the cluster key.
Application domain indexes This type of index is created by a user for data in an application-specific domain. The physical index need not use a traditional index structure and can be stored either in the Oracle database as tables or externally as a file. Accommodate indexes on customized, complex data types such as documents, spatial data, images, and video clips (see &quot;Unstructured Data&quot;) . The application software, called the  cartridge, controls the structure and content of a domain index. The database interacts with the application to build, maintain, and search the domain index. The index structure itself can be stored in the database as an index-organized table or externally as a file.
Domain indexes Domain indexes are built using the indexing logic supplied by a user-defined indextype. An indextype provides an efficient mechanism to access data that satisfy certain operator predicates. Typically, the user-defined indextype is part of an Oracle Database option, like the Spatial option.

More Related Content

PPT
Myth busters - performance tuning 101 2007
PPTX
Part3 Explain the Explain Plan
PPTX
Ground Breakers Romania: Explain the explain_plan
ODP
SQL Tunning
ODP
Oracle SQL Advanced
PPTX
Lab1 select statement
PPT
Advanced Sql Training
Myth busters - performance tuning 101 2007
Part3 Explain the Explain Plan
Ground Breakers Romania: Explain the explain_plan
SQL Tunning
Oracle SQL Advanced
Lab1 select statement
Advanced Sql Training

What's hot (20)

PPTX
Oracle: Basic SQL
PPTX
Part4 Influencing Execution Plans with Optimizer Hints
PPT
SQL select statement and functions
PPTX
1. dml select statement reterive data
PPT
Sql server select queries ppt 18
PPT
Retrieving data using the sql select statement
PPT
Sql DML
PPTX
How mysql choose the execution plan
PPT
Oracle SQL, PL/SQL best practices
PPTX
Where conditions and Operators in SQL
PPT
Sql select
PDF
Introduction to oracle functions
PDF
Introduction to Databases - query optimizations for MySQL
PPT
Les01 (retrieving data using the sql select statement)
PDF
OBIEE 12c Advanced Analytic Functions
PDF
Introduction To Oracle Sql
PPTX
Advanced functions in PL SQL
PPT
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
PDF
Database development coding standards
PDF
TSQL Coding Guidelines
Oracle: Basic SQL
Part4 Influencing Execution Plans with Optimizer Hints
SQL select statement and functions
1. dml select statement reterive data
Sql server select queries ppt 18
Retrieving data using the sql select statement
Sql DML
How mysql choose the execution plan
Oracle SQL, PL/SQL best practices
Where conditions and Operators in SQL
Sql select
Introduction to oracle functions
Introduction to Databases - query optimizations for MySQL
Les01 (retrieving data using the sql select statement)
OBIEE 12c Advanced Analytic Functions
Introduction To Oracle Sql
Advanced functions in PL SQL
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
Database development coding standards
TSQL Coding Guidelines
Ad

Viewers also liked (12)

PPTX
Malaysiabus presentation
PPTX
A look into Sarawakian Youth, from a youth's perspective
PPTX
Kenali sarawak
PPT
Bab 10 Sarawak
PPT
Pakaian tradisional
PPT
Bab 11 Sabah
PPTX
(Full)epc assignment sarawak cultural village
PPTX
Iban culture
PPTX
Sarawak
PPTX
SARAWAK
PPTX
Adat resam iban, melanau, bidayuh
PPT
Lord Cranbrook 50++years of Swiflet Research
Malaysiabus presentation
A look into Sarawakian Youth, from a youth's perspective
Kenali sarawak
Bab 10 Sarawak
Pakaian tradisional
Bab 11 Sabah
(Full)epc assignment sarawak cultural village
Iban culture
Sarawak
SARAWAK
Adat resam iban, melanau, bidayuh
Lord Cranbrook 50++years of Swiflet Research
Ad

Similar to Sydney Oracle Meetup - indexes (20)

PPTX
In Sync11 Presentation The Biggest Loser
PDF
Advanced MySQL Query Optimizations
PPTX
Sql server lesson6
PDF
Application sql issues_and_tuning
PDF
Brad McGehee Intepreting Execution Plans Mar09
PDF
Brad McGehee Intepreting Execution Plans Mar09
PDF
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
PPT
Module08
PPT
Module08
PPTX
02 database oprimization - improving sql performance - ent-db
PPT
15 Ways to Kill Your Mysql Application Performance
PPT
IBM Informix Database SQL Set operators and ANSI Hash Join
PDF
Optimized cluster index generation
PDF
Art of indexing_in_o8i
PPTX
SQL Server 2008 Development for Programmers
PPT
Sql tuning guideline
PDF
MySQL Query And Index Tuning
DOCX
PPTX
Relational Database Management System
In Sync11 Presentation The Biggest Loser
Advanced MySQL Query Optimizations
Sql server lesson6
Application sql issues_and_tuning
Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
Module08
Module08
02 database oprimization - improving sql performance - ent-db
15 Ways to Kill Your Mysql Application Performance
IBM Informix Database SQL Set operators and ANSI Hash Join
Optimized cluster index generation
Art of indexing_in_o8i
SQL Server 2008 Development for Programmers
Sql tuning guideline
MySQL Query And Index Tuning
Relational Database Management System

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Approach and Philosophy of On baking technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Digital-Transformation-Roadmap-for-Companies.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectral efficient network and resource selection model in 5G networks
Building Integrated photovoltaic BIPV_UPV.pdf
MYSQL Presentation for SQL database connectivity
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...

Sydney Oracle Meetup - indexes

  • 1. Sydney Oracle Meetup - Indexes Paul Guerin OCP Meetup presenter 4 times in past 10 months Development/Production DBA at Origin Energy for past 3.5 years Previous employers: Bluescope Steel (Wollongong), BHP Billiton (Wollongong) 2010 Oxfam Trailwalker: Origin Trail Breakers http://www2.oxfam.org.au/trailwalker/Sydney/team/67 Includes photos from Heysen trail and Flinders rangers….
  • 2. Indexes - general An index is an optional structure, that can sometimes speed data access. Indexes are also used with integrity constraints. eg unique key, primary key Table rows in which all key columns are null are not indexed , except for bitmap indexes or when the cluster key column value is null. Can place partitioned (local, global) or non-partitioned indexes on a partitioned table. Can place partitioned (global) or non-partitioned indexes on a non-partitioned table.
  • 3. Cluster Factor The clustering factor is useful as a rough measure of the number of I/Os required to read an entire table by an index range scan . Compare the cluster factor with a FTS (ie the HWM for a table). Lower the ratio the better (best ratio=1). select index_name, clustering_factor, clustering_factor/blocks from dba_tables a, dba_indexes b where a.owner=b.table_owner and a.table_name=b.table_name and a.owner=upper('&own') and a.table_name=upper('&tbl') order by 3; INDEX_NAME CLUSTERING_FACTOR CLUSTERING_FACTOR/BLOCKS ----------------- ----------------- ------------------------ CNT$BLT 4320 3.4887097 CNT$CNT_SCN 7682 6.1916129 CNT$CNTNM 23360 18.8387097 CNT$PK_CNTID 49939 40.2733871 CNT$DLNMBR 55664 44.8903226 In many situations the cluster factor can be disregarded.
  • 4. Usable or unusable Not maintained by DML operations and is ignored by the optimizer. Instead of dropping an index and later re-creating it, you can make the index unusable and then rebuild it. Beginning with Oracle Database 11g Release 2, when you make an existing index unusable, its index segment is dropped. CREATE INDEX myemp_ename ON emp(ename) TABLESPACE users UNUSABLE; Note: Truncating a table makes an unusable index usable.
  • 5. Visible or invisible An invisible index is maintained by DML operations, but is not used by the CBO. Used to test the removal of an index before dropping it. ALTER INDEX index INVISIBLE; ALTER INDEX index VISIBLE;
  • 6. Monitoring Index Usage A means of monitoring indexes to determine whether they are being used. If an index is not being used, then it can be dropped. -- start monitoring an index ALTER INDEX <index> MONITORING USAGE; -- stop monitoring an index ALTER INDEX <index> NOMONITORING USAGE; The view V$OBJECT_USAGE can be queried for the index being monitored to see if the index has been used. select * from V$OBJECT_USAGE where table_name=‘<table>'; Note1: Need to login as the owner of the index. Note2: Doesn’t monitor usage for the child index on a foreign key when the parent primary/unique key is modified. Note3: Monitors other accesses eg gather stats, and explain plan.
  • 7. Monitoring Space Use of Indexes Monitor index efficiency of space usage by analysing, then querying: /* Prevents DML by default so add the ONLINE clause */ analyze index <schema>.<index> validate structure online; SELECT PCT_USED FROM INDEX_STATS; SELECT PCT_USED FROM INDEX_HISTOGRAM;
  • 8. Rebuild or Coalesce When rebuilding, querying is allowed but DDL is not. Unless you use the ONLINE clause DML is not allowed either. /* performance improvement with NOLOGGING clause */ /* Don’t lock the table with the ONLINE clause */ ALTER INDEX <schema.name> REBUILD NOLOGGING ONLINE; Start online index builds when DML activity is low. Parallel execution is not supported when creating or rebuilding an index online. /* Coalese also available - don’t need twice the index space */ ALTER INDEX <schema.name> COALESCE; ALTER INDEX ... SHRINK SPACE COMPACT;
  • 9. B-tree indexes Short for balanced tree , and are the most common type of index. Excellent retrieval performance for a wide range of queries, including exact match and range searches. Descending index: Descending indexes are useful when a query sorts some columns ascending and others descending. Database can use this index to retrieve the data and avoid the extra step of sorting it in descending order.
  • 10. B-tree indexes Reverse Key: Bytes of the index key are reversed, so inserts are spread over many index blocks. Reversing the key solves the problem of contention for leaf blocks in the right side of a B-tree index. This problem can be especially acute in an Oracle Real Application Clusters (Oracle RAC) database in which multiple instances repeatedly modify the same block. Index range scanning is limited because not sorted by key column. Note: As inserts are distributed across the index - cluster factor becomes much worse.
  • 11. B-tree indexes Key compression: ANALYZE INDEX <schema.name> VALIDATE STRUCTURE; SELECT name, partition_name, blocks, opt_cmpr_count, opt_cmpr_pctsave FROM INDEX_STATS; CREATE INDEX emp_ename ON emp(ename) COMPRESS 1; SELECT compress, prefix_length FROM dba_indexes WHERE owner=‘<owner>’ and table_name = ‘<table>’; Example: non-compressed index: online,0,AAAPvCAAFAAAAFaAAa online,0,AAAPvCAAFAAAAFaAAg online,0,AAAPvCAAFAAAAFaAAl online,2,AAAPvCAAFAAAAFaAAm online,3,AAAPvCAAFAAAAFaAAq online,3,AAAPvCAAFAAAAFaAAt
  • 12. B-tree indexes compressed index (specified prefix length 1): online 0,AAAPvCAAFAAAAFaAAa 0,AAAPvCAAFAAAAFaAAg 0,AAAPvCAAFAAAAFaAAl 2,AAAPvCAAFAAAAFaAAm 3,AAAPvCAAFAAAAFaAAq 3,AAAPvCAAFAAAAFaAAt compressed index (default prefix – not always optimal): online,0 AAAPvCAAFAAAAFaAAa AAAPvCAAFAAAAFaAAg AAAPvCAAFAAAAFaAAl online,2 AAAPvCAAFAAAAFaAAm online,3 AAAPvCAAFAAAAFaAAq AAAPvCAAFAAAAFaAAt
  • 13. Index Organised Tables (IOTs) The data is stored inside the index. There is no table. Rows are stored in an index defined on the primary key for the table. (in a normal table, inserts are where ever they can fit). Index-organized tables provide faster key-based access to table data for queries that involve exact match or range search or both. The presence of non-key columns of a row in the leaf block avoids an additional data block I/O.
  • 14. Index Organised Tables (IOTs) A secondary index is an index on an index-organized table. In a sense, it is an index on an index. The secondary index is an independent schema object and is stored separately from the index-organized table. Secondary indexes provide fast and efficient access to index-organized tables using columns that are neither the primary key nor a prefix of the primary key. A secondary index on an index-organized table can be a bitmap index.
  • 15. Bitmap indexes In a bitmap index, the database stores a bitmap for each index key. (In a B-tree index, one index entry points to a single row.) In a bitmap index, each index key stores pointers to multiple rows. Useful when: The indexed columns have low cardinality, that is, the number of distinct values is small compared to the number of table rows. The indexed table is either read-only or not subject to significant modification by DML statements. The WHERE clause contains multiple predicates on low- or medium-cardinality columns. The individual predicates on these low- or medium-cardinality columns select a large number of rows. The bitmap indexes used in the queries have been created on some or all of these low- or medium-cardinality columns. The tables in the queries contain many rows.
  • 16. Bitmap indexes Bitmap indexes can include keys that consist entirely of null values, unlike B-tree indexes. Conceptually, an index leaf contains entries as follows: index key, low rowid and high rowid, a bitmap for those rowids. Shipping Clerk,AAAPzRAAFAAAABSABQ,AAAPzRAAFAAAABSABZ,0010000100 Shipping Clerk,AAAPzRAAFAAAABSABa,AAAPzRAAFAAAABSABh,010010 Stock Clerk,AAAPzRAAFAAAABSAAa,AAAPzRAAFAAAABSAAc,1001001100 Stock Clerk,AAAPzRAAFAAAABSAAd,AAAPzRAAFAAAABSAAt,0101001001 Stock Clerk,AAAPzRAAFAAAABSAAu,AAAPzRAAFAAAABSABz,100001 If the indexed column in a single row is updated, then the database locks the index key entry and not the individual bit mapped to the updated row. Because a key points to many rows, DML on indexed data typically locks all of these rows. For this reason, bitmap indexes are not appropriate for many OLTP applications.
  • 17. Bitmap join indexes A bitmap join index is a bitmap index for the join of two or more tables. In a bitmap index, an index entry uses a bitmap to point to multiple rows. In contrast, a B-tree index entry points to a single row. For each value in a table column, the index stores the rowid of the corresponding row in the indexed table.
  • 18. Bitmap join indexes CREATE BITMAP INDEX employees_bm_idx ON employees (jobs.job_title) FROM employees, jobs WHERE employees.job_id = jobs.job_id; SELECT COUNT(*) FROM employees, jobs WHERE employees.job_id = jobs.job_id AND jobs.job_title = 'Accountant'; Bitmap join indexes are sometimes much more efficient in storage than materialized join views.
  • 19. Function-based indexes Include columns that are either transformed by a function, or within an expression. Can be B-tree or bitmap. The database only uses the function-based index when the function is included in a query. CREATE INDEX emp_total_sal_idx ON employees ( 12 * salary * commission_pct , salary, commission_pct); SELECT employee_id, last_name, first_name, 12*salary*commission_pct AS &quot;ANNUAL SAL&quot; FROM employees WHERE (12 * salary * commission_pct) < 30000 ORDER BY &quot;ANNUAL SAL&quot; DESC; A function-based index is also useful for indexing only specific rows in a table. eg Index only the A rows: CREATE INDEX cust_valid_idx ON customers ( CASE cust_valid WHEN 'A' THEN 'A' END );
  • 20. B-tree cluster indexes This type of index is used to index a table cluster key. Instead of pointing to a row, the key points to the block that contains rows related to the cluster key.
  • 21. Application domain indexes This type of index is created by a user for data in an application-specific domain. The physical index need not use a traditional index structure and can be stored either in the Oracle database as tables or externally as a file. Accommodate indexes on customized, complex data types such as documents, spatial data, images, and video clips (see &quot;Unstructured Data&quot;) . The application software, called the cartridge, controls the structure and content of a domain index. The database interacts with the application to build, maintain, and search the domain index. The index structure itself can be stored in the database as an index-organized table or externally as a file.
  • 22. Domain indexes Domain indexes are built using the indexing logic supplied by a user-defined indextype. An indextype provides an efficient mechanism to access data that satisfy certain operator predicates. Typically, the user-defined indextype is part of an Oracle Database option, like the Spatial option.

Editor's Notes

  • #2: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #3: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #4: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #5: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #6: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #7: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #8: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #9: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #10: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #11: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #12: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #13: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #14: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #15: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #16: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #17: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #18: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #19: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #20: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #21: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #22: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade
  • #23: Installation, configuration, upgrading of Oracle server software and related products eg upgrade of PSSPRODs to 10g, install and configure 11g ETPP, ETOP, STTM databases Design / Validate DB backup and recovery procedures including HA, DR eg NETS, GETS, PSSPROD, NETSREPP, MTMs, ETOP with Data guard Performance monitoring eg NETS Contract queue, load profile Application / business processes monitoring eg OEM monitor: NEMMCO feeds, charge run Implement database security eg accounts creation, user access privileges, security auditing total over 1000 accounts, monitor unsuccessful login to database, review user privileges Capacity Planning monitor/trend table size, identify tables for archiving, data purge, periodic table rebuilds to reduce database size Troubleshoot application problems interface to Oracle databases work with developers to identify performance bottleneck in QLDNOMS application, Gas charge run Database upgrades and patching PSSPROD 10g upgrade, 11g upgrade