SlideShare uma empresa Scribd logo
1 de 12
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Five Tips to Get the
Most out of Your Indexes
1
Maria Colgan
Master Product Manager
Oracle Database Server Technologies
June 2018
JEFF
@SQLMaria
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
B-Tree Indexes
– Available since 5, they are the
most common type of index
– Goal: minimize time to find
small amounts of data
– Including function-based,
Reverse Key Indexes, & IOTs
– One to one mapping, little
degradation in retrieval
performance as underlying
table grows
Bitmap Indexes
– Available since 7.3, designed
for read-mostly workloads
– Goal: Improve performance
of ad-hoc analytic queries
– A single bitmap key entry
points to many rows
– Multiple indexes can be used
together to determine rowids
– Bitmap Join indexes replaces
need for two table join
2
Text Search Indexes
– Available since 8i designed for
text retrieval
– Goal: Quickly identify large
coherent documents
– Can index documents of
different formats such as MS
Word, HTML or plain text
– A single entry points to many
documents
Oracle Offers a Variety of Different Indexing Techniques
Root Block
leaf Blocks
Branch Blocks
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Reverse Key Indexes
• Reverse key indexes physically stores the bytes of the keys in reverse order
– CREATE INDEX sales_prod_reverse_idx ON sales(prod_id) REVERSE;
• Used to avoid “hot block syndrome” or buffer busy waits
– On columns with monotonically increasing values
– Eg: sequence populated fields or dates/timestamps
• At a cost
– Prevents some index range scans as 5 is not stored next to 6
• Equality predicates on non-unique index will use index range scan
• Range predicates such as between, <, > etc. may not use index
– Additional CPU evident mostly in single user mode, with multi-users you see less
overall CPU because you are not spinning on a buffer wait
Relieving Index contention
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Partially Useable Indexes
• Enables the creation of local or global indexes on just a subset of partitions
• Indexing only the stable partitions (little or no DML) minimizes the impact
on ingest performance
• Queries accessing data only within the indexed partitions will use the index
• Queries that access data only in the non-indexed partitions will do full scan
• Queries accessing partitions with and without indexes can take advantage
of the query transformation called Table Expansion
• Supported by definition on Partition views
4
Relieving Index contention
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Partially Useable Indexes
CREATE TABLE sales(order_status char(6) not null, order_date…)
INDEXING ON
PARTITION BY LIST (order_status)(
PARTITION p1 VALUES(‘OPEN’) INDEXING OFF,
PARTITION p2 VALUES(‘CLOSED’));
5
Relieving Index contention
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Table Expansion Transformation
6
P1: ORDER_STATUS=‘OPEN’
SELECT * FROM sales
WHERE ORDER_DATE between‘2017-01-01’ and ‘2017-12-31’;
P2: ORDER_STATUS=‘CLOSED’
P1: Best access path is full table scan
SALES
P2: Best access path is index scan
Local index on
ORDER_DATE
IDX_SALES: ORDER_DATE
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Table Expansion Transformation
----------------------------------------------------------------------
| Id | Operation | Name | Pstart| Pstop |
----------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | |
| 1 | SORT AGGREGATE | | | |
| 2 | VIEW | VW_TE_2 | | |
| 3 | UNION-ALL | | | |
| 4 | PARTITION RANGE SINGLE | | 1 | 1 |
|* 5 | TABLE ACCESS FULL | SALES | 1 | 1 |
| 6 | PARTITION RANGE SINGLE | | 2 | 2 |
|* 7 | INDEX RANGE SCAN | IDX_SALES | 2 | 2 |
----------------------------------------------------------------------
5 - access("ORDER_DATE“>=TO_DATE(' 2017-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
"ORDER_DATE"<=TO_DATE(' 2018-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
filter("ORDER_DATE“>=TO_DATE(' 2017-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
"ORDER_DATE"<=TO_DATE(' 2018-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
7 - access("ORDER_DATE“>=TO_DATE(' 2017-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
"ORDER_DATE"<=TO_DATE(' 2018-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Indexing Nulls
• Bitmap indexes – always index nulls
• B*Tree cluster indexes – always index nulls
• B*Tree indexes do not if and only if the entire key is null (all columns)
8
CREATE INDEX i ON t(object_id,0);
SELECT * FROM t WHERE object_id is NULL;
-------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1445 | 149K| 96 (0)| 00:00:02 |
| 1 | TABLE ACCESS BY INDEX ROWID| T | 1445 | 149K| 96 (0)| 00:00:02 |
|* 2 | INDEX RANGE SCAN | I | 1445 | | 7 (0)| 00:00:01 |
-------------------------------------------------------------------------------------
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 9
• How do I know which indexes are actually
needed?
• New DBA_INDEX_USAGE views provide usage
histograms and access details for all indexes
• Track index usage with no overhead
Index Usage Statistics
Public
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Index Usage Statistics
10Public
Index entries with no statistics
indicate indexes that currently are
not being used
These are potential candidates to
be deleted
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
INVISIBLE Indexes
• Ability to create and maintains an index that the optimizer is blind to
– Optimizer can’t use an invisible index as an access method
• Easy mechanism to begin the process of removing unused indexes
1. Mark the index invisible
ALTER INDEX i INVISIBLE;
2. If no one misses it for a complete business cycle, its safe to drop it
• Also useful to test out the benefit of a new index before publishing it
1. Create invisible index
CREATE INDEX i ON t(x, object_id) INVISIBLE;
2. Set parameter OPTIMIZER_USE_INVISIBLE_INDEXES to true in 1 session to test
ALTER SESSION SET optimizer_use_invisible_indexes=true;
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Indexes are a critical tool to help improve performance
12
Indexes
ORACLE
Use them wisely to
greatly improve speed of
data access …..
…Over use them and you
will grind the system to a
halt!

Mais conteúdo relacionado

Mais procurados

The Changing Role of a DBA in an Autonomous World
The Changing Role of a DBA in an Autonomous WorldThe Changing Role of a DBA in an Autonomous World
The Changing Role of a DBA in an Autonomous WorldMaria Colgan
 
One Less Thing For DBAs to Worry About: Automatic Indexing
One Less Thing For DBAs to Worry About: Automatic IndexingOne Less Thing For DBAs to Worry About: Automatic Indexing
One Less Thing For DBAs to Worry About: Automatic IndexingJim Czuprynski
 
Sql parametrized queries
Sql parametrized queriesSql parametrized queries
Sql parametrized queriesHadi Fadlallah
 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Supportnkarag
 
Gl wand-5.5-brochure-2014
Gl wand-5.5-brochure-2014Gl wand-5.5-brochure-2014
Gl wand-5.5-brochure-2014Jarod Ouye
 
Creating Views - oracle database
Creating Views - oracle databaseCreating Views - oracle database
Creating Views - oracle databaseSalman Memon
 
Implementing views
Implementing views Implementing views
Implementing views sqlschoolgr
 
Database performance tuning and query optimization
Database performance tuning and query optimizationDatabase performance tuning and query optimization
Database performance tuning and query optimizationUsman Tariq
 
The Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL ServerThe Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL ServerJason Strate
 
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...Trivadis
 
Oracle advanced supply chain planning implementation and user
Oracle advanced supply chain planning implementation and userOracle advanced supply chain planning implementation and user
Oracle advanced supply chain planning implementation and userSairam Laga
 
Oracle Database 12c features for DBA
Oracle Database 12c features for DBAOracle Database 12c features for DBA
Oracle Database 12c features for DBAKaran Kukreja
 
The Database Environment Chapter 7
The Database Environment Chapter 7The Database Environment Chapter 7
The Database Environment Chapter 7Jeanie Arnoco
 
Chapter 08 abap dictionary objects views1
Chapter 08 abap dictionary objects views1Chapter 08 abap dictionary objects views1
Chapter 08 abap dictionary objects views1Kranthi Kumar
 
Managing Statistics for Optimal Query Performance
Managing Statistics for Optimal Query PerformanceManaging Statistics for Optimal Query Performance
Managing Statistics for Optimal Query PerformanceKaren Morton
 

Mais procurados (20)

The Changing Role of a DBA in an Autonomous World
The Changing Role of a DBA in an Autonomous WorldThe Changing Role of a DBA in an Autonomous World
The Changing Role of a DBA in an Autonomous World
 
One Less Thing For DBAs to Worry About: Automatic Indexing
One Less Thing For DBAs to Worry About: Automatic IndexingOne Less Thing For DBAs to Worry About: Automatic Indexing
One Less Thing For DBAs to Worry About: Automatic Indexing
 
Sql parametrized queries
Sql parametrized queriesSql parametrized queries
Sql parametrized queries
 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
 
Gl wand-5.5-brochure-2014
Gl wand-5.5-brochure-2014Gl wand-5.5-brochure-2014
Gl wand-5.5-brochure-2014
 
Aggreagate awareness
Aggreagate awarenessAggreagate awareness
Aggreagate awareness
 
Creating Views - oracle database
Creating Views - oracle databaseCreating Views - oracle database
Creating Views - oracle database
 
Implementing views
Implementing views Implementing views
Implementing views
 
SQLDay2013_MarcinSzeliga_StoredProcedures
SQLDay2013_MarcinSzeliga_StoredProceduresSQLDay2013_MarcinSzeliga_StoredProcedures
SQLDay2013_MarcinSzeliga_StoredProcedures
 
Database performance tuning and query optimization
Database performance tuning and query optimizationDatabase performance tuning and query optimization
Database performance tuning and query optimization
 
CAR EVALUATION DATABASE
CAR EVALUATION DATABASECAR EVALUATION DATABASE
CAR EVALUATION DATABASE
 
Remus_3_0
Remus_3_0Remus_3_0
Remus_3_0
 
The Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL ServerThe Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL Server
 
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...
 
Calnf
CalnfCalnf
Calnf
 
Oracle advanced supply chain planning implementation and user
Oracle advanced supply chain planning implementation and userOracle advanced supply chain planning implementation and user
Oracle advanced supply chain planning implementation and user
 
Oracle Database 12c features for DBA
Oracle Database 12c features for DBAOracle Database 12c features for DBA
Oracle Database 12c features for DBA
 
The Database Environment Chapter 7
The Database Environment Chapter 7The Database Environment Chapter 7
The Database Environment Chapter 7
 
Chapter 08 abap dictionary objects views1
Chapter 08 abap dictionary objects views1Chapter 08 abap dictionary objects views1
Chapter 08 abap dictionary objects views1
 
Managing Statistics for Optimal Query Performance
Managing Statistics for Optimal Query PerformanceManaging Statistics for Optimal Query Performance
Managing Statistics for Optimal Query Performance
 

Semelhante a Five Tips to Get the Most Out of Your Indexing

MySQL partitioning
MySQL partitioning MySQL partitioning
MySQL partitioning OracleMySQL
 
Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4 Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4 EDB
 
Optimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptxOptimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptxJasonTuran2
 
How to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performanceHow to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performanceoysteing
 
Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4EDB
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ICarlos Oliveira
 
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better PerformanceHow to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performanceoysteing
 
What's New MySQL 8.0?
What's New MySQL 8.0?What's New MySQL 8.0?
What's New MySQL 8.0?OracleMySQL
 
Tips tricks to speed nw bi 2009
Tips tricks to speed  nw bi  2009Tips tricks to speed  nw bi  2009
Tips tricks to speed nw bi 2009HawaDia
 
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...EDB
 
FDMEE Can Do That?
FDMEE Can Do That?FDMEE Can Do That?
FDMEE Can Do That?Alithya
 
Big SQL 3.0 - Fast and easy SQL on Hadoop
Big SQL 3.0 - Fast and easy SQL on HadoopBig SQL 3.0 - Fast and easy SQL on Hadoop
Big SQL 3.0 - Fast and easy SQL on HadoopWilfried Hoge
 
IRJET- A Comprehensive Review on Query Optimization for Distributed Databases
IRJET- A Comprehensive Review on Query Optimization for Distributed DatabasesIRJET- A Comprehensive Review on Query Optimization for Distributed Databases
IRJET- A Comprehensive Review on Query Optimization for Distributed DatabasesIRJET Journal
 
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...Dave Stokes
 
IRJET- Analysis for EnhancedForecastof Expense Movement in Stock Exchange
IRJET- Analysis for EnhancedForecastof Expense Movement in Stock ExchangeIRJET- Analysis for EnhancedForecastof Expense Movement in Stock Exchange
IRJET- Analysis for EnhancedForecastof Expense Movement in Stock ExchangeIRJET Journal
 
Utilizing BI 11g Reporting To Get The Most Out of P6
Utilizing BI 11g Reporting To Get The Most Out of P6Utilizing BI 11g Reporting To Get The Most Out of P6
Utilizing BI 11g Reporting To Get The Most Out of P6p6academy
 
Vision Reporting - Configuration Tips
Vision Reporting - Configuration TipsVision Reporting - Configuration Tips
Vision Reporting - Configuration TipsSysco Software
 
MySQL 5.7 New Features to Exploit -- PHPTek/Chicago MySQL User Group May 2014
MySQL 5.7 New Features to Exploit -- PHPTek/Chicago MySQL User Group May 2014MySQL 5.7 New Features to Exploit -- PHPTek/Chicago MySQL User Group May 2014
MySQL 5.7 New Features to Exploit -- PHPTek/Chicago MySQL User Group May 2014Dave Stokes
 
Sitecore user group mumbai sitecore commerce extension
Sitecore user group mumbai  sitecore commerce extensionSitecore user group mumbai  sitecore commerce extension
Sitecore user group mumbai sitecore commerce extensionJitendra Soni
 

Semelhante a Five Tips to Get the Most Out of Your Indexing (20)

MySQL partitioning
MySQL partitioning MySQL partitioning
MySQL partitioning
 
Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4 Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4
 
Optimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptxOptimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptx
 
How to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performanceHow to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performance
 
Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
 
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better PerformanceHow to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
 
What's New MySQL 8.0?
What's New MySQL 8.0?What's New MySQL 8.0?
What's New MySQL 8.0?
 
Tips tricks to speed nw bi 2009
Tips tricks to speed  nw bi  2009Tips tricks to speed  nw bi  2009
Tips tricks to speed nw bi 2009
 
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
 
FDMEE Can Do That?
FDMEE Can Do That?FDMEE Can Do That?
FDMEE Can Do That?
 
Big SQL 3.0 - Fast and easy SQL on Hadoop
Big SQL 3.0 - Fast and easy SQL on HadoopBig SQL 3.0 - Fast and easy SQL on Hadoop
Big SQL 3.0 - Fast and easy SQL on Hadoop
 
IRJET- A Comprehensive Review on Query Optimization for Distributed Databases
IRJET- A Comprehensive Review on Query Optimization for Distributed DatabasesIRJET- A Comprehensive Review on Query Optimization for Distributed Databases
IRJET- A Comprehensive Review on Query Optimization for Distributed Databases
 
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
 
IRJET- Analysis for EnhancedForecastof Expense Movement in Stock Exchange
IRJET- Analysis for EnhancedForecastof Expense Movement in Stock ExchangeIRJET- Analysis for EnhancedForecastof Expense Movement in Stock Exchange
IRJET- Analysis for EnhancedForecastof Expense Movement in Stock Exchange
 
Utilizing BI 11g Reporting To Get The Most Out of P6
Utilizing BI 11g Reporting To Get The Most Out of P6Utilizing BI 11g Reporting To Get The Most Out of P6
Utilizing BI 11g Reporting To Get The Most Out of P6
 
Vision Reporting - Configuration Tips
Vision Reporting - Configuration TipsVision Reporting - Configuration Tips
Vision Reporting - Configuration Tips
 
MySQL 5.7 New Features to Exploit -- PHPTek/Chicago MySQL User Group May 2014
MySQL 5.7 New Features to Exploit -- PHPTek/Chicago MySQL User Group May 2014MySQL 5.7 New Features to Exploit -- PHPTek/Chicago MySQL User Group May 2014
MySQL 5.7 New Features to Exploit -- PHPTek/Chicago MySQL User Group May 2014
 
Indexes overview
Indexes overviewIndexes overview
Indexes overview
 
Sitecore user group mumbai sitecore commerce extension
Sitecore user group mumbai  sitecore commerce extensionSitecore user group mumbai  sitecore commerce extension
Sitecore user group mumbai sitecore commerce extension
 

Mais de Maria Colgan

Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptx
Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptxFive_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptx
Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptxMaria Colgan
 
Part4 Influencing Execution Plans with Optimizer Hints
Part4 Influencing Execution Plans with Optimizer HintsPart4 Influencing Execution Plans with Optimizer Hints
Part4 Influencing Execution Plans with Optimizer HintsMaria Colgan
 
Ground Breakers Romania: Oracle Autonomous Database
Ground Breakers Romania: Oracle Autonomous DatabaseGround Breakers Romania: Oracle Autonomous Database
Ground Breakers Romania: Oracle Autonomous DatabaseMaria Colgan
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19cMaria Colgan
 
Oracle Database in-Memory Overivew
Oracle Database in-Memory OverivewOracle Database in-Memory Overivew
Oracle Database in-Memory OverivewMaria Colgan
 
JSON and the Oracle Database
JSON and the Oracle DatabaseJSON and the Oracle Database
JSON and the Oracle DatabaseMaria Colgan
 
Harnessing the Power of Optimizer Hints
Harnessing the Power of Optimizer HintsHarnessing the Power of Optimizer Hints
Harnessing the Power of Optimizer HintsMaria Colgan
 
Oracle optimizer bootcamp
Oracle optimizer bootcampOracle optimizer bootcamp
Oracle optimizer bootcampMaria Colgan
 
What_to_expect_from_oracle_database_12c
What_to_expect_from_oracle_database_12cWhat_to_expect_from_oracle_database_12c
What_to_expect_from_oracle_database_12cMaria Colgan
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsMaria Colgan
 

Mais de Maria Colgan (10)

Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptx
Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptxFive_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptx
Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptx
 
Part4 Influencing Execution Plans with Optimizer Hints
Part4 Influencing Execution Plans with Optimizer HintsPart4 Influencing Execution Plans with Optimizer Hints
Part4 Influencing Execution Plans with Optimizer Hints
 
Ground Breakers Romania: Oracle Autonomous Database
Ground Breakers Romania: Oracle Autonomous DatabaseGround Breakers Romania: Oracle Autonomous Database
Ground Breakers Romania: Oracle Autonomous Database
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
 
Oracle Database in-Memory Overivew
Oracle Database in-Memory OverivewOracle Database in-Memory Overivew
Oracle Database in-Memory Overivew
 
JSON and the Oracle Database
JSON and the Oracle DatabaseJSON and the Oracle Database
JSON and the Oracle Database
 
Harnessing the Power of Optimizer Hints
Harnessing the Power of Optimizer HintsHarnessing the Power of Optimizer Hints
Harnessing the Power of Optimizer Hints
 
Oracle optimizer bootcamp
Oracle optimizer bootcampOracle optimizer bootcamp
Oracle optimizer bootcamp
 
What_to_expect_from_oracle_database_12c
What_to_expect_from_oracle_database_12cWhat_to_expect_from_oracle_database_12c
What_to_expect_from_oracle_database_12c
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOps
 

Último

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 

Último (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Five Tips to Get the Most Out of Your Indexing

  • 1. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Five Tips to Get the Most out of Your Indexes 1 Maria Colgan Master Product Manager Oracle Database Server Technologies June 2018 JEFF @SQLMaria
  • 2. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | B-Tree Indexes – Available since 5, they are the most common type of index – Goal: minimize time to find small amounts of data – Including function-based, Reverse Key Indexes, & IOTs – One to one mapping, little degradation in retrieval performance as underlying table grows Bitmap Indexes – Available since 7.3, designed for read-mostly workloads – Goal: Improve performance of ad-hoc analytic queries – A single bitmap key entry points to many rows – Multiple indexes can be used together to determine rowids – Bitmap Join indexes replaces need for two table join 2 Text Search Indexes – Available since 8i designed for text retrieval – Goal: Quickly identify large coherent documents – Can index documents of different formats such as MS Word, HTML or plain text – A single entry points to many documents Oracle Offers a Variety of Different Indexing Techniques Root Block leaf Blocks Branch Blocks
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Reverse Key Indexes • Reverse key indexes physically stores the bytes of the keys in reverse order – CREATE INDEX sales_prod_reverse_idx ON sales(prod_id) REVERSE; • Used to avoid “hot block syndrome” or buffer busy waits – On columns with monotonically increasing values – Eg: sequence populated fields or dates/timestamps • At a cost – Prevents some index range scans as 5 is not stored next to 6 • Equality predicates on non-unique index will use index range scan • Range predicates such as between, <, > etc. may not use index – Additional CPU evident mostly in single user mode, with multi-users you see less overall CPU because you are not spinning on a buffer wait Relieving Index contention
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Partially Useable Indexes • Enables the creation of local or global indexes on just a subset of partitions • Indexing only the stable partitions (little or no DML) minimizes the impact on ingest performance • Queries accessing data only within the indexed partitions will use the index • Queries that access data only in the non-indexed partitions will do full scan • Queries accessing partitions with and without indexes can take advantage of the query transformation called Table Expansion • Supported by definition on Partition views 4 Relieving Index contention
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Partially Useable Indexes CREATE TABLE sales(order_status char(6) not null, order_date…) INDEXING ON PARTITION BY LIST (order_status)( PARTITION p1 VALUES(‘OPEN’) INDEXING OFF, PARTITION p2 VALUES(‘CLOSED’)); 5 Relieving Index contention
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Table Expansion Transformation 6 P1: ORDER_STATUS=‘OPEN’ SELECT * FROM sales WHERE ORDER_DATE between‘2017-01-01’ and ‘2017-12-31’; P2: ORDER_STATUS=‘CLOSED’ P1: Best access path is full table scan SALES P2: Best access path is index scan Local index on ORDER_DATE IDX_SALES: ORDER_DATE
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Table Expansion Transformation ---------------------------------------------------------------------- | Id | Operation | Name | Pstart| Pstop | ---------------------------------------------------------------------- | 0 | SELECT STATEMENT | | | | | 1 | SORT AGGREGATE | | | | | 2 | VIEW | VW_TE_2 | | | | 3 | UNION-ALL | | | | | 4 | PARTITION RANGE SINGLE | | 1 | 1 | |* 5 | TABLE ACCESS FULL | SALES | 1 | 1 | | 6 | PARTITION RANGE SINGLE | | 2 | 2 | |* 7 | INDEX RANGE SCAN | IDX_SALES | 2 | 2 | ---------------------------------------------------------------------- 5 - access("ORDER_DATE“>=TO_DATE(' 2017-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "ORDER_DATE"<=TO_DATE(' 2018-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss')) filter("ORDER_DATE“>=TO_DATE(' 2017-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "ORDER_DATE"<=TO_DATE(' 2018-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss')) 7 - access("ORDER_DATE“>=TO_DATE(' 2017-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "ORDER_DATE"<=TO_DATE(' 2018-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Indexing Nulls • Bitmap indexes – always index nulls • B*Tree cluster indexes – always index nulls • B*Tree indexes do not if and only if the entire key is null (all columns) 8 CREATE INDEX i ON t(object_id,0); SELECT * FROM t WHERE object_id is NULL; ------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1445 | 149K| 96 (0)| 00:00:02 | | 1 | TABLE ACCESS BY INDEX ROWID| T | 1445 | 149K| 96 (0)| 00:00:02 | |* 2 | INDEX RANGE SCAN | I | 1445 | | 7 (0)| 00:00:01 | -------------------------------------------------------------------------------------
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 9 • How do I know which indexes are actually needed? • New DBA_INDEX_USAGE views provide usage histograms and access details for all indexes • Track index usage with no overhead Index Usage Statistics Public
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Index Usage Statistics 10Public Index entries with no statistics indicate indexes that currently are not being used These are potential candidates to be deleted
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | INVISIBLE Indexes • Ability to create and maintains an index that the optimizer is blind to – Optimizer can’t use an invisible index as an access method • Easy mechanism to begin the process of removing unused indexes 1. Mark the index invisible ALTER INDEX i INVISIBLE; 2. If no one misses it for a complete business cycle, its safe to drop it • Also useful to test out the benefit of a new index before publishing it 1. Create invisible index CREATE INDEX i ON t(x, object_id) INVISIBLE; 2. Set parameter OPTIMIZER_USE_INVISIBLE_INDEXES to true in 1 session to test ALTER SESSION SET optimizer_use_invisible_indexes=true;
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Indexes are a critical tool to help improve performance 12 Indexes ORACLE Use them wisely to greatly improve speed of data access ….. …Over use them and you will grind the system to a halt!