9223301.ppt

1
Chapter 5
Index and Clustering
2
Overview of Indexes and Clustering
 B-tree indexes
 Bitmap indexes (and bitmap join indexes)
 Index-organized tables (IOT)
 Hash Clusters
 Index Cluster
 Nested Tables
3
B-tree Indexes
 “Balanced tree” – has hierarchical tree
structure
– Header block
 Contains pointers to “Branch blocks” for given value sets
– Branch blocks
 Contains pointers to other branch blocks, or
 Contains pointers to “Leaf Blocks”
– Leaf Blocks
 Contains list of key values and pointers (ROWIDS) to
actual table row data
 See figures 5-1 (p. 112), 5-2 (p. 113)
4
B-tree Indexes (cont.)
 Can provide efficient query performance
– Header, branch blocks often in memory
– Reading leafs blocks to retrieve data requires often
few I/O’s
– Goal is to keep “balanced” tree
 Maintenance can be expensive
 Index splits can occur
– Reduces performances and increases I/O
– Requires rebuild to repair
5
B-tree Indexes (cont.)
 Index selectivity
– Is a measure of usefulness of an index
– Selective for columns with large number of unique
values
– More efficient than non-selective indexes because
they point to more specific values
 Unique Indexes
– No duplicate values allowed
– Very selective by nature
6
B-tree Indexes (cont.)
 Implicit Indexes
– Created automatically by oracle
– For unique and primary key constraints
– For some object type tables
 Concatenated Indexes
– More than one column makes up the index
– Usually more selective than single column index
– Effective if leading column is used in WHERE clause
7
B-tree Indexes (cont.)
 Concatenated Indexes (cont.)
– Create index statement example
CREATE INDEX emp_name_ix on employees
(Last_name, first_name)
– Query example that uses index
SELECT cust_id
FROM sh.customers c
WHERE first_name = ‘Connor’
AND last_name = ‘Bishop’ (leading column of index)
AND cust_year_of_birth = 1976;
8
B-tree Indexes (cont.)
 Concatenated Indexes (cont.)
– “Covering Index”
 Query that only uses indexed columns
 Means table data need not be read
 Only Index needs to be read
– Index skip-scans
 Means using index when leading column not used
 Works best when leading column is less selective
9
B-tree Indexes (cont.)
 Guidelines for use of concatenated indexes
– Create if WHERE clause needs these columns together
– Analyze which column is best suited to be the leading column
– The more selective a column is, the better it is as the leading
column
 Isn’t true if wanting to use only non-leading column
 Keep in mind Index skip-scan performs less than a normal range
scan (i.e. try to use leading column)
– Supports queries that doesn’t use all the columns of the index
in the WHERE clause (e.g. if only using the leading column)
10
B-tree Indexes (cont.)
 Index merges
– Performed by Oracle if more than one column in the
WHERE clause
– Is an alternative to a concatenated index if individual
indexes exist on columns in WHERE clause
– Merges values for the values of each column
– Generally less efficient than concatenated index
– If seen in EXPLAIN PLAN consider creating
concatenated index
11
B-tree Indexes (cont.)
 Null values in indexes
– No value represented in B-tree index for NULLS
– Therefore, index can’t find NULL values
– So, use NOT NULL for indexed columns where
possible
– Conditions exist where may be acceptable
 Column is almost always null
 You never want to find rows where the column in NULL
 Want to minimized space required for index
12
B-tree Indexes (cont.)
 Reverse key indexes
– Can create with REVERSE keyword
– For example stores ‘Smith’ as ‘htimS’
– Can reduce contention for the leading edge of an index
– New entries spread more evenly across index
– However, range scans no longer possible
– Consider if the count is high for:
 Buffer busy waits
 Cache buffer chains latch waits
– Also beneficial in RAC implementations (Chapter 23)
13
B-tree Indexes (cont.)
 Index compression
– Oracle allows leaf block compression
– Works best on concatenated indexes where leading
part is repeated (e.g. Last Name of Smith would be
likely repeated)
– Saves storage
– Reduces I/O operations
– Can reduce index “height”
14
B-tree Indexes (cont.)
 Functional Indexes
– Means creating an index on an expression
CREATE INDEX cust_uppr_name_ix ON customers
(UPPER(cust_last_name),UPPER(cust_first_time));
– Use with care, can produce incorrect results
 See the use of the DETERMINISTIC keyword
15
B-tree Indexes (cont.)
 Foreign Keys and Locking
– Indexing foreign key columns can prevent table-level
locking and reduce lock contention
– These indexes reduce lock contention more than
improve query performance
– These indexes help optimize DELETE CASCADE
operations
– Locks especially occur if parent table is subject to
primary key updates or deletions
16
B-tree Indexes (cont.)
 Indexes and Partitioning
– Local index means index partitioned in same manner as data
 There is a 1-1 relationship between data partition and index
partition values
– Global index means index partitioned differently than table
– Key goal is to achieve partition elimination for queries (read
only a portion of the table or index)
– Maintenance on global indexes higher than local indexes
– Global indexes more often used in OLTP applications
17
Bitmap Indexes
 Completely different structure than B-tree
 Oracle creates bitmap for each unique value of a single
column
 Each bitmap contains a single bit (0 or 1) for each row
– ‘1’ means row matches value in bitmap
– ‘0’ means row does not match value in bitmap
 See Figure 5-7 (p. 125)
 Efficient for non-selective columns (e.g. gender)
 Very compact, fast to create
 Often used with Star Schema implementations
 Not recommended if many updates occur on column(s)
used for bitmap index
18
Bitmap Indexes (cont.)
 Index merge operations more efficient than B-tree
 Bitmap join indexes
– Identifies rows in one table that have matching value in 2nd table
– Can prevent join of two tables
– Example of bitmap join index:
CREATE BITMAP INDEX sales_bm_join_i ON sales
(c.cust_email)
FROM sales s, customers c
WHERE s.cust_id = c.cust_id;
19
Index overhead
 Indexes reduce performance of DML operations
 Columns with high update activity will have more
significant DML overhead
 Batch deletes incur very high overhead,
especially with non-unique indexes
 Ensure indexes are used in user queries in order
to reduce DML overhead where possible
– Use MONITORING USAGE clause to validate if index
is being used, or
– Monitor V$SQL_PLAN view
20
Index Organized Tables (IOT)
 Stored as B-tree index
 Entire table is stored as index
 Avoids duplicating storage of data and index
 Key lookups are fast as data is in leaf block of
index
 Can in turn mean more leaf blocks needed
 Can optionally store some of the data in an
“overflow segment”
21
Index Organized Tables (IOT)
 The overflow segment
– You have some control over which columns live here
– Can specify different tablespace for overflow
– Generally a good idea to have
– Can reduce depth of an index
– May require more frequent rebuilds
– See Figure 5-13, 5-14, 5-15 (pp. 135-137)
22
Clustering
 Two basic types
– Index cluster
 Storing rows from multiple tables with same key values in the
same block
 Speeds up joins
 Usually only used in specific circumstances
 Disadvantages include
– Full table scans against one of the clustered tables is slower
– Inserts are slower
– Join performance increase may be nominal
– May require frequent rebuilds
23
Clustering (cont.)
 Two basic types (cont.)
– Hash cluster
 Stores rows in a location deduced algorithmically
 Reduces number of I/O operations needed
 Can reduce contention of oft-used blocks
 Consider using when
– High selectivity (high cardinality)
– Optimization of primary key lookups is desired
24
Nested Tables
 Is an object type with relational characteristics
 Can define column in table of that object type
 One table appears to be nested within a column
of another table
 See code snippet example on p. 149
25
Choosing an Index Strategy
 Need to weigh the use of
– B-tree
– Bitmap
– Hash Clusters
 See Table 5-1 (pp. 150-151) for comparisons
1 sur 25

Recommandé

Performance By Design par
Performance By DesignPerformance By Design
Performance By DesignGuy Harrison
818 vues58 diapositives
Optimized cluster index generation par
Optimized cluster index generationOptimized cluster index generation
Optimized cluster index generationRutvik Pensionwar
64 vues4 diapositives
Database Performance par
Database PerformanceDatabase Performance
Database PerformanceBoris Hristov
3.6K vues39 diapositives
Indexing Strategies par
Indexing StrategiesIndexing Strategies
Indexing Strategiesjlaspada
401 vues20 diapositives
Art of indexing_in_o8i par
Art of indexing_in_o8iArt of indexing_in_o8i
Art of indexing_in_o8iAnil Pandey
460 vues17 diapositives
Myth busters - performance tuning 102 2008 par
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008paulguerin
296 vues26 diapositives

Contenu connexe

Similaire à 9223301.ppt

SQL Server Index and Partition Strategy par
SQL Server Index and Partition StrategySQL Server Index and Partition Strategy
SQL Server Index and Partition StrategyHamid J. Fard
712 vues15 diapositives
Tunning overview par
Tunning overviewTunning overview
Tunning overviewHitesh Kumar Markam
736 vues30 diapositives
Getting to know oracle database objects iot, mviews, clusters and more… par
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Aaron Shilo
1.3K vues72 diapositives
Sql server lesson6 par
Sql server lesson6Sql server lesson6
Sql server lesson6Ala Qunaibi
84 vues36 diapositives
Sydney Oracle Meetup - indexes par
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexespaulguerin
590 vues22 diapositives
Sql performance tuning par
Sql performance tuningSql performance tuning
Sql performance tuningLeo Mark Villar
287 vues27 diapositives

Similaire à 9223301.ppt(20)

SQL Server Index and Partition Strategy par Hamid J. Fard
SQL Server Index and Partition StrategySQL Server Index and Partition Strategy
SQL Server Index and Partition Strategy
Hamid J. Fard712 vues
Getting to know oracle database objects iot, mviews, clusters and more… par Aaron Shilo
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…
Aaron Shilo1.3K vues
Sydney Oracle Meetup - indexes par paulguerin
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexes
paulguerin590 vues
MySQL Indexing par BADR
MySQL IndexingMySQL Indexing
MySQL Indexing
BADR120 vues
Improved Query Performance With Variant Indexes - review presentation par Vimukthi Wickramasinghe
Improved Query Performance With Variant Indexes - review presentationImproved Query Performance With Variant Indexes - review presentation
Improved Query Performance With Variant Indexes - review presentation
The International Journal of Engineering and Science (The IJES) par theijes
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
theijes308 vues
Filtered Indexes In Sql 2008 par wharrislv
Filtered Indexes In Sql 2008Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008
wharrislv520 vues
Mohan Testing par smittal81
Mohan TestingMohan Testing
Mohan Testing
smittal81198 vues
Intro to Data warehousing Lecture 04 par AnwarrChaudary
Intro to Data warehousing   Lecture 04Intro to Data warehousing   Lecture 04
Intro to Data warehousing Lecture 04
AnwarrChaudary43 vues
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona) par Ontico
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)
Ontico4.1K vues

Plus de KalsoomTahir2

005813616.pdf par
005813616.pdf005813616.pdf
005813616.pdfKalsoomTahir2
1 vue17 diapositives
009576860.pdf par
009576860.pdf009576860.pdf
009576860.pdfKalsoomTahir2
1 vue29 diapositives
005813185.pdf par
005813185.pdf005813185.pdf
005813185.pdfKalsoomTahir2
1 vue45 diapositives
HASH FUNCTIONS.pdf par
HASH FUNCTIONS.pdfHASH FUNCTIONS.pdf
HASH FUNCTIONS.pdfKalsoomTahir2
5 vues21 diapositives
6. McCall's Model.pptx par
6. McCall's Model.pptx6. McCall's Model.pptx
6. McCall's Model.pptxKalsoomTahir2
4 vues13 diapositives
ch02-Database System Concepts and Architecture.ppt par
ch02-Database System Concepts and Architecture.pptch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.pptKalsoomTahir2
12 vues53 diapositives

Plus de KalsoomTahir2(20)

ch02-Database System Concepts and Architecture.ppt par KalsoomTahir2
ch02-Database System Concepts and Architecture.pptch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.ppt
KalsoomTahir212 vues
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt par KalsoomTahir2
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
KalsoomTahir23 vues

Dernier

Introduction to AERO Supply Chain - #BEAERO Trainning program par
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning programGuennoun Wajih
135 vues78 diapositives
MercerJesse3.0.pdf par
MercerJesse3.0.pdfMercerJesse3.0.pdf
MercerJesse3.0.pdfjessemercerail
183 vues6 diapositives
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023 par
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023A Guide to Applying for the Wells Mountain Initiative Scholarship 2023
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023Excellence Foundation for South Sudan
89 vues26 diapositives
Peripheral artery diseases by Dr. Garvit.pptx par
Peripheral artery diseases by Dr. Garvit.pptxPeripheral artery diseases by Dr. Garvit.pptx
Peripheral artery diseases by Dr. Garvit.pptxgarvitnanecha
135 vues48 diapositives
What is Digital Transformation? par
What is Digital Transformation?What is Digital Transformation?
What is Digital Transformation?Mark Brown
46 vues11 diapositives
Thanksgiving!.pdf par
Thanksgiving!.pdfThanksgiving!.pdf
Thanksgiving!.pdfEnglishCEIPdeSigeiro
597 vues17 diapositives

Dernier(20)

Introduction to AERO Supply Chain - #BEAERO Trainning program par Guennoun Wajih
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning program
Guennoun Wajih135 vues
Peripheral artery diseases by Dr. Garvit.pptx par garvitnanecha
Peripheral artery diseases by Dr. Garvit.pptxPeripheral artery diseases by Dr. Garvit.pptx
Peripheral artery diseases by Dr. Garvit.pptx
garvitnanecha135 vues
What is Digital Transformation? par Mark Brown
What is Digital Transformation?What is Digital Transformation?
What is Digital Transformation?
Mark Brown46 vues
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating... par Taste
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Taste39 vues
Education of marginalized and socially disadvantages segments.pptx par GarimaBhati5
Education of marginalized and socially disadvantages segments.pptxEducation of marginalized and socially disadvantages segments.pptx
Education of marginalized and socially disadvantages segments.pptx
GarimaBhati552 vues
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (FRIE... par Nguyen Thanh Tu Collection
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (FRIE...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (FRIE...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (FRIE...
12.5.23 Poverty and Precarity.pptx par mary850239
12.5.23 Poverty and Precarity.pptx12.5.23 Poverty and Precarity.pptx
12.5.23 Poverty and Precarity.pptx
mary850239559 vues
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 par MysoreMuleSoftMeetup
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx par Niranjan Chavan
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptxGuidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Niranjan Chavan43 vues
11.21.23 Economic Precarity and Global Economic Forces.pptx par mary850239
11.21.23 Economic Precarity and Global Economic Forces.pptx11.21.23 Economic Precarity and Global Economic Forces.pptx
11.21.23 Economic Precarity and Global Economic Forces.pptx
mary85023994 vues
OOPs - JAVA Quick Reference.pdf par ArthyR3
OOPs - JAVA Quick Reference.pdfOOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdf
ArthyR376 vues
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption... par BC Chew
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
BC Chew40 vues
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab... par RAHUL PAL
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...
RAHUL PAL45 vues

9223301.ppt

  • 2. 2 Overview of Indexes and Clustering  B-tree indexes  Bitmap indexes (and bitmap join indexes)  Index-organized tables (IOT)  Hash Clusters  Index Cluster  Nested Tables
  • 3. 3 B-tree Indexes  “Balanced tree” – has hierarchical tree structure – Header block  Contains pointers to “Branch blocks” for given value sets – Branch blocks  Contains pointers to other branch blocks, or  Contains pointers to “Leaf Blocks” – Leaf Blocks  Contains list of key values and pointers (ROWIDS) to actual table row data  See figures 5-1 (p. 112), 5-2 (p. 113)
  • 4. 4 B-tree Indexes (cont.)  Can provide efficient query performance – Header, branch blocks often in memory – Reading leafs blocks to retrieve data requires often few I/O’s – Goal is to keep “balanced” tree  Maintenance can be expensive  Index splits can occur – Reduces performances and increases I/O – Requires rebuild to repair
  • 5. 5 B-tree Indexes (cont.)  Index selectivity – Is a measure of usefulness of an index – Selective for columns with large number of unique values – More efficient than non-selective indexes because they point to more specific values  Unique Indexes – No duplicate values allowed – Very selective by nature
  • 6. 6 B-tree Indexes (cont.)  Implicit Indexes – Created automatically by oracle – For unique and primary key constraints – For some object type tables  Concatenated Indexes – More than one column makes up the index – Usually more selective than single column index – Effective if leading column is used in WHERE clause
  • 7. 7 B-tree Indexes (cont.)  Concatenated Indexes (cont.) – Create index statement example CREATE INDEX emp_name_ix on employees (Last_name, first_name) – Query example that uses index SELECT cust_id FROM sh.customers c WHERE first_name = ‘Connor’ AND last_name = ‘Bishop’ (leading column of index) AND cust_year_of_birth = 1976;
  • 8. 8 B-tree Indexes (cont.)  Concatenated Indexes (cont.) – “Covering Index”  Query that only uses indexed columns  Means table data need not be read  Only Index needs to be read – Index skip-scans  Means using index when leading column not used  Works best when leading column is less selective
  • 9. 9 B-tree Indexes (cont.)  Guidelines for use of concatenated indexes – Create if WHERE clause needs these columns together – Analyze which column is best suited to be the leading column – The more selective a column is, the better it is as the leading column  Isn’t true if wanting to use only non-leading column  Keep in mind Index skip-scan performs less than a normal range scan (i.e. try to use leading column) – Supports queries that doesn’t use all the columns of the index in the WHERE clause (e.g. if only using the leading column)
  • 10. 10 B-tree Indexes (cont.)  Index merges – Performed by Oracle if more than one column in the WHERE clause – Is an alternative to a concatenated index if individual indexes exist on columns in WHERE clause – Merges values for the values of each column – Generally less efficient than concatenated index – If seen in EXPLAIN PLAN consider creating concatenated index
  • 11. 11 B-tree Indexes (cont.)  Null values in indexes – No value represented in B-tree index for NULLS – Therefore, index can’t find NULL values – So, use NOT NULL for indexed columns where possible – Conditions exist where may be acceptable  Column is almost always null  You never want to find rows where the column in NULL  Want to minimized space required for index
  • 12. 12 B-tree Indexes (cont.)  Reverse key indexes – Can create with REVERSE keyword – For example stores ‘Smith’ as ‘htimS’ – Can reduce contention for the leading edge of an index – New entries spread more evenly across index – However, range scans no longer possible – Consider if the count is high for:  Buffer busy waits  Cache buffer chains latch waits – Also beneficial in RAC implementations (Chapter 23)
  • 13. 13 B-tree Indexes (cont.)  Index compression – Oracle allows leaf block compression – Works best on concatenated indexes where leading part is repeated (e.g. Last Name of Smith would be likely repeated) – Saves storage – Reduces I/O operations – Can reduce index “height”
  • 14. 14 B-tree Indexes (cont.)  Functional Indexes – Means creating an index on an expression CREATE INDEX cust_uppr_name_ix ON customers (UPPER(cust_last_name),UPPER(cust_first_time)); – Use with care, can produce incorrect results  See the use of the DETERMINISTIC keyword
  • 15. 15 B-tree Indexes (cont.)  Foreign Keys and Locking – Indexing foreign key columns can prevent table-level locking and reduce lock contention – These indexes reduce lock contention more than improve query performance – These indexes help optimize DELETE CASCADE operations – Locks especially occur if parent table is subject to primary key updates or deletions
  • 16. 16 B-tree Indexes (cont.)  Indexes and Partitioning – Local index means index partitioned in same manner as data  There is a 1-1 relationship between data partition and index partition values – Global index means index partitioned differently than table – Key goal is to achieve partition elimination for queries (read only a portion of the table or index) – Maintenance on global indexes higher than local indexes – Global indexes more often used in OLTP applications
  • 17. 17 Bitmap Indexes  Completely different structure than B-tree  Oracle creates bitmap for each unique value of a single column  Each bitmap contains a single bit (0 or 1) for each row – ‘1’ means row matches value in bitmap – ‘0’ means row does not match value in bitmap  See Figure 5-7 (p. 125)  Efficient for non-selective columns (e.g. gender)  Very compact, fast to create  Often used with Star Schema implementations  Not recommended if many updates occur on column(s) used for bitmap index
  • 18. 18 Bitmap Indexes (cont.)  Index merge operations more efficient than B-tree  Bitmap join indexes – Identifies rows in one table that have matching value in 2nd table – Can prevent join of two tables – Example of bitmap join index: CREATE BITMAP INDEX sales_bm_join_i ON sales (c.cust_email) FROM sales s, customers c WHERE s.cust_id = c.cust_id;
  • 19. 19 Index overhead  Indexes reduce performance of DML operations  Columns with high update activity will have more significant DML overhead  Batch deletes incur very high overhead, especially with non-unique indexes  Ensure indexes are used in user queries in order to reduce DML overhead where possible – Use MONITORING USAGE clause to validate if index is being used, or – Monitor V$SQL_PLAN view
  • 20. 20 Index Organized Tables (IOT)  Stored as B-tree index  Entire table is stored as index  Avoids duplicating storage of data and index  Key lookups are fast as data is in leaf block of index  Can in turn mean more leaf blocks needed  Can optionally store some of the data in an “overflow segment”
  • 21. 21 Index Organized Tables (IOT)  The overflow segment – You have some control over which columns live here – Can specify different tablespace for overflow – Generally a good idea to have – Can reduce depth of an index – May require more frequent rebuilds – See Figure 5-13, 5-14, 5-15 (pp. 135-137)
  • 22. 22 Clustering  Two basic types – Index cluster  Storing rows from multiple tables with same key values in the same block  Speeds up joins  Usually only used in specific circumstances  Disadvantages include – Full table scans against one of the clustered tables is slower – Inserts are slower – Join performance increase may be nominal – May require frequent rebuilds
  • 23. 23 Clustering (cont.)  Two basic types (cont.) – Hash cluster  Stores rows in a location deduced algorithmically  Reduces number of I/O operations needed  Can reduce contention of oft-used blocks  Consider using when – High selectivity (high cardinality) – Optimization of primary key lookups is desired
  • 24. 24 Nested Tables  Is an object type with relational characteristics  Can define column in table of that object type  One table appears to be nested within a column of another table  See code snippet example on p. 149
  • 25. 25 Choosing an Index Strategy  Need to weigh the use of – B-tree – Bitmap – Hash Clusters  See Table 5-1 (pp. 150-151) for comparisons