SlideShare a Scribd company logo
© Copyright 2015. Apps Associates LLC. 1
Performance Tuning Overview
March 30, 2015
© Copyright 2015. Apps Associates LLC. 2
Indexing
© Copyright 2015. Apps Associates LLC. 3
0..50
51..100
101..150
….
10000.. 10050
0..10
11..19
20..25
….
47.. 50
51..58
59..63
64..75
….
98.. 100
10000.. 10009
10010.. 10020
10021..10028
…
10046..10050
0,rowid
0,rowid
1,rowid
….
10,rowid
11,rowid
11,rowid
12,rowid
….
19,rowid
10046,rowid
10048,rowid
10048,rowid
….
10050,rowid
….
….
10021,rowid
10022,rowid
10023,rowid
….
10028,rowid
….
Create index I on T(numColumn)
© Copyright 2015. Apps Associates LLC. 4
B*Tree When to use
• CLUSTERING FACTOR
– A measure of how sorted the table is by the key in the index
– It measures how many IO’s it would take to read the entire table via the index – row
after row after row
– If table is sorted by key, clustering factor near number of blocks in the table.
– If table is not sorted by key, clustering factor nearer number of ROWS in table.
– Please ask yourself, how many ways can the table be sorted on disk?
© Copyright 2015. Apps Associates LLC. 5
1,Alice
2,Bob
3,Candy
4,Doug
5,Ellen
6,Frank
7,George
8,Hank
….
….
….
….
….
… …
…
…
…
….
0..50
51..100
101..150
….
10000.. 100500..10
11..19
20..25
….
47.. 50
51..58
59..63
64..75
….
98.. 100
10000.. 10009
10010.. 10020
10021..10028
…
10046..10050
….
Create index nm_idx on name)
Select * from t where pk between 1 and 8
Pk Name
1 Alice
2 Sue
3 Victor
4 Will
Pk Name
5 Irene
6 Kelly
7 Melanie
8 Oliver
Pk Name
9 George
10 Candy
11 Uwe
12 Wally
Pk Name
13 Ellen
14 Tom
15 Rick
16 Paul
Pk Name
17 Doug
18 Irene
19 Lance
20 Jack
Pk Name
21 Hank
22 Frank
23 Nicole
24 Bob
© Copyright 2015. Apps Associates LLC. 6
1,Alice
2,Bob
3,Candy
4,Doug
5,Ellen
6,Frank
7,George
8,Hank
….
….
….
….
….
… …
…
…
…
….
0..50
51..100
101..150
….
10000.. 100500..10
11..19
20..25
….
47.. 50
51..58
59..63
64..75
….
98.. 100
10000.. 10009
10010.. 10020
10021..10028
…
10046..10050
….
Create index nm_idx on name)
Select * from t where Name between ‘Alice’ and ‘Hank’
Pk Name
1 Alice
2 Sue
3 Victor
4 Will
Pk Name
5 Irene
6 Kelly
7 Melanie
8 Oliver
Pk Name
9 George
10 Candy
11 Uwe
12 Wally
Pk Name
13 Ellen
14 Tom
15 Rick
16 Paul
Pk Name
17 Doug
18 Irene
19 Lance
20 Jack
Pk Name
21 Hank
22 Frank
23 Nicole
24 Bob
Access paths – Getting the data
Access Path Explanation
Full table scan Reads all rows from table & filters out those that do not meet the where clause predicates. Used when no
index, DOP set etc
Table access by Rowid Rowid specifies the datafile & data block containing the row and the location of the row in that block. Used if
rowid supplied by index or in where clause
Index unique scan Only one row will be returned. Used when stmt contains a UNIQUE or a PRIMARY KEY constraint that
guarantees that only a single row is accessed
Index range scan Accesses adjacent index entries returns ROWID values Used with equality on non-unique indexes or range
predicate on unique index (<.>, between etc)
Index skip scan Skips the leading edge of the index & uses the rest Advantageous if there are few distinct values in the leading
column and many distinct values in the non-leading column
Full index scan Processes all leaf blocks of an index, but only enough branch blocks to find 1st leaf block. Used when all
necessary columns are in index & order by clause matches index struct or if sort merge join is done
Fast full index scan Scans all blocks in index used to replace a FTS when all necessary columns are in the index. Using multi-block IO
& can going parallel
Index joins Hash join of several indexes that together contain all the table columns that are referenced in the query. Wont
eliminate a sort operation
Bitmap indexes uses a bitmap for key values and a mapping function that converts each bit position to a rowid. Can efficiently
merge indexes that correspond to several conditions in a WHERE clause
© Copyright 2015. Apps Associates LLC. 8
Reverse Key Index
• Physically stores the bytes of the keys in reverse order
• In general, typically prevents range scanning
– 5 is not stored next to 6 is not stored next to 7…
• Used to avoid “hot block syndrome”
• Can also be used to avoid having to re-organize a ‘sweeping’ index
© Copyright 2015. Apps Associates LLC. 9
Reverse Key Index - performance
• It can help with buffer busy waits
– On monotonically increasing values
– Eg: sequence populated fields
– Eg: date/timestamp fields
• Especially in a clustered environment, this can reduce latency
• At the cost of additional CPU
– Evident mostly in single user mode
– When you go multi-user, because you are not spinning on a buffer wait, you see
less overall CPU
© Copyright 2015. Apps Associates LLC. 10
Reverse Key Index - performance
• PL/SQL still more efficient
• Reverse Key index has measurable impact for PL/SQL
Single User PL/SQL Pro*C
Reverse No Reverse Reverse No Reverse
Transaction/second 38.24 43.45 17.35 19.08
CPU time (seconds) 25 22 33 31
Buffer busy waits number/time 0/0 0/0 0/0 0/0
Elapsed time (minutes) 0.42 0.37 0.92 0.83
Log file sync number/time 6/0 1,940/7 1,940/7
© Copyright 2015. Apps Associates LLC. 11
Reverse Key Index - performance
Transaction/second 46.59 49.03 20.07 20.29
CPU time (seconds) 77 73 104 101
Buffer busy waits number/time 4,267/2 133,644/2 3,286/0 23,688/1
Elapsed time (minutes) 0.68 0.65 1.58 1.57
Log file sync number/time 19/0 18/0 3,273/29 2,132/29
PL/SQL Pro*C
Reverse No Reverse Reverse No Reverse
• PL/SQL still more efficient
• Reverse Key index has measurable impact for PL/SQL in this case
Two Users
© Copyright 2015. Apps Associates LLC. 12
Reverse Key Index - performance
PL/SQL still more efficient
Reverse Key index has impressively measurable effect
As we scale up – this will have more of an impact
At low concurrency, little impact
Ten Users
PL/SQL Pro*C
Reverse No Reverse Reverse No Reverse
Transaction/second 45.90 35.38 17.88 16.05
CPU time (seconds) 781 789 1,256 1,384
Buffer busy waits number/time 26k/279 456k/1,382 25k/134 364k/1702
Elapsed time (minutes) 3.47 4.50 8.90 9.92
Log file sync number/time 2,602/72 11k/196 12k/141
What basic statistics to collect
• By default the following basic table & column statistic are collected
– Number of Rows
– Number of blocks
– Average row length
– Number of distinct values
– Number of nulls in column
What basic statistics to collect
• Index statistics are automatically gathered during creation and maintained
by GATHER_TABLE_STATS and include
– Number of leaf blocks
– Branch Levels
– Clustering factor
• 12c – Tables have basic statistics gathered
during loads into empty segments too
What basic statistics to collect
• Histograms tell Optimizer about the data distribution in a Column
• Creation controlled by METHOD_OPT parameter
• Default create histogram on any column that has been used in the WHERE
clause or GROUP BY of a statement AND has a data skew
• Relies on column usage information gathered at compilation time and
stored in SYS.COL_USAGE$
Histograms
What basic statistics to collect
• 11g and before - Two types of histograms
– Frequency
– Height-balanced
• 12c and after – two more
– Top Frequency
– Hybrid
Histograms
Histograms
• A frequency histogram is only created if the number of distinct values in a
column (NDV) is less than 254 values
Frequency histograms (FREQUENCY)
Frequency histogram
Histograms
• A height balanced histogram is created if the number of distinct values in a
column (NDV) is greater than 254 values
Height balanced histograms (HEIGHT BALANCED)
Height balanced histogram
Histograms
• Traditionally a frequency histogram is only created if NDV < 254
• But if a small number of values occupies most of the rows (>99% rows)
• Creating a frequency histograms on that small set of values is very useful even
though NDV is greater than 254
• Ignores the unpopular values to create a better quality histogram for
popular values
• Built using the same technique used for frequency histograms
• Only created with AUTO_SAMPLE_SIZE
Top Frequency (TOP-FREQUENCY) 12c
Histograms
• Similar to height balanced histogram as created if the NDV >254
• Store the actual frequencies of bucket endpoints in histograms
• No values are allowed to spill over multiple buckets
• More endpoint values can be squeezed in a histogram
• Achieves the same effect as increasing the # of buckets
• Only created with AUTO_SAMPLE_SIZE
Hybrid Histograms (HYBRID) 12c
© Copyright 2015. Apps Associates LLC. 21
Thank You!

More Related Content

What's hot

Aman sharma hyd_12crac High Availability Day 2015
Aman sharma hyd_12crac High Availability Day 2015Aman sharma hyd_12crac High Availability Day 2015
Aman sharma hyd_12crac High Availability Day 2015
aioughydchapter
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
Berry Clemens
 
Oracle IaaS Overview - AIOUG Hyderabad Chapter
Oracle IaaS Overview - AIOUG Hyderabad ChapterOracle IaaS Overview - AIOUG Hyderabad Chapter
Oracle IaaS Overview - AIOUG Hyderabad Chapter
aioughydchapter
 
Dg broker &amp; client connectivity - High Availability Day 2015
Dg broker &amp; client connectivity -  High Availability Day 2015Dg broker &amp; client connectivity -  High Availability Day 2015
Dg broker &amp; client connectivity - High Availability Day 2015
aioughydchapter
 
Database and application performance vivek sharma
Database and application performance vivek sharmaDatabase and application performance vivek sharma
Database and application performance vivek sharma
aioughydchapter
 
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business SuiteOOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
vasuballa
 
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and AdministerOracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
Andrejs Karpovs
 
Dmz aa aioug
Dmz aa aiougDmz aa aioug
Dmz aa aioug
pasalapudi123
 
R12.2.5 new features
R12.2.5 new featuresR12.2.5 new features
R12.2.5 new features
TahirGhafoor
 
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and AdministerOracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Andrejs Karpovs
 
How to Use EXAchk Effectively to Manage Exadata Environments
How to Use EXAchk Effectively to Manage Exadata EnvironmentsHow to Use EXAchk Effectively to Manage Exadata Environments
How to Use EXAchk Effectively to Manage Exadata Environments
Sandesh Rao
 
Upgrading Em13c Collaborate 2016
Upgrading Em13c Collaborate 2016Upgrading Em13c Collaborate 2016
Upgrading Em13c Collaborate 2016
Kellyn Pot'Vin-Gorman
 
What’s New in Oracle E-Business Suite R12.2 for Database Administrators?
What’s New in Oracle E-Business Suite R12.2 for Database Administrators?What’s New in Oracle E-Business Suite R12.2 for Database Administrators?
What’s New in Oracle E-Business Suite R12.2 for Database Administrators?
vasuballa
 
E business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsE business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administrators
Srinivasa Pavan Marti
 
GLOC 2014 NEOOUG - R12 Upgrade Downtime Reduction
GLOC 2014 NEOOUG - R12 Upgrade Downtime ReductionGLOC 2014 NEOOUG - R12 Upgrade Downtime Reduction
GLOC 2014 NEOOUG - R12 Upgrade Downtime Reduction
Biju Thomas
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret Internals
Anil Nair
 
Preparing for EBS R12.2-upgrade-full
Preparing for EBS R12.2-upgrade-fullPreparing for EBS R12.2-upgrade-full
Preparing for EBS R12.2-upgrade-fullBerry Clemens
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
Scott Jenner
 
OOW15 - technical upgrade best practices for oracle e-business suite 12.2
OOW15 - technical upgrade best practices for oracle e-business suite 12.2OOW15 - technical upgrade best practices for oracle e-business suite 12.2
OOW15 - technical upgrade best practices for oracle e-business suite 12.2
vasuballa
 
Oracle E-Business Suite on Kubernetes Cluster
Oracle E-Business Suite on Kubernetes ClusterOracle E-Business Suite on Kubernetes Cluster
Oracle E-Business Suite on Kubernetes Cluster
vasuballa
 

What's hot (20)

Aman sharma hyd_12crac High Availability Day 2015
Aman sharma hyd_12crac High Availability Day 2015Aman sharma hyd_12crac High Availability Day 2015
Aman sharma hyd_12crac High Availability Day 2015
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
 
Oracle IaaS Overview - AIOUG Hyderabad Chapter
Oracle IaaS Overview - AIOUG Hyderabad ChapterOracle IaaS Overview - AIOUG Hyderabad Chapter
Oracle IaaS Overview - AIOUG Hyderabad Chapter
 
Dg broker &amp; client connectivity - High Availability Day 2015
Dg broker &amp; client connectivity -  High Availability Day 2015Dg broker &amp; client connectivity -  High Availability Day 2015
Dg broker &amp; client connectivity - High Availability Day 2015
 
Database and application performance vivek sharma
Database and application performance vivek sharmaDatabase and application performance vivek sharma
Database and application performance vivek sharma
 
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business SuiteOOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
 
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and AdministerOracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
 
Dmz aa aioug
Dmz aa aiougDmz aa aioug
Dmz aa aioug
 
R12.2.5 new features
R12.2.5 new featuresR12.2.5 new features
R12.2.5 new features
 
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and AdministerOracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
 
How to Use EXAchk Effectively to Manage Exadata Environments
How to Use EXAchk Effectively to Manage Exadata EnvironmentsHow to Use EXAchk Effectively to Manage Exadata Environments
How to Use EXAchk Effectively to Manage Exadata Environments
 
Upgrading Em13c Collaborate 2016
Upgrading Em13c Collaborate 2016Upgrading Em13c Collaborate 2016
Upgrading Em13c Collaborate 2016
 
What’s New in Oracle E-Business Suite R12.2 for Database Administrators?
What’s New in Oracle E-Business Suite R12.2 for Database Administrators?What’s New in Oracle E-Business Suite R12.2 for Database Administrators?
What’s New in Oracle E-Business Suite R12.2 for Database Administrators?
 
E business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsE business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administrators
 
GLOC 2014 NEOOUG - R12 Upgrade Downtime Reduction
GLOC 2014 NEOOUG - R12 Upgrade Downtime ReductionGLOC 2014 NEOOUG - R12 Upgrade Downtime Reduction
GLOC 2014 NEOOUG - R12 Upgrade Downtime Reduction
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret Internals
 
Preparing for EBS R12.2-upgrade-full
Preparing for EBS R12.2-upgrade-fullPreparing for EBS R12.2-upgrade-full
Preparing for EBS R12.2-upgrade-full
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
 
OOW15 - technical upgrade best practices for oracle e-business suite 12.2
OOW15 - technical upgrade best practices for oracle e-business suite 12.2OOW15 - technical upgrade best practices for oracle e-business suite 12.2
OOW15 - technical upgrade best practices for oracle e-business suite 12.2
 
Oracle E-Business Suite on Kubernetes Cluster
Oracle E-Business Suite on Kubernetes ClusterOracle E-Business Suite on Kubernetes Cluster
Oracle E-Business Suite on Kubernetes Cluster
 

Viewers also liked

Getting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteGetting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suite
aioughydchapter
 
Ebs12.2 online patching
Ebs12.2 online patching Ebs12.2 online patching
Ebs12.2 online patching
aioughydchapter
 
veshaal-singh-ebs-oracle cloud(iaas+paas)
veshaal-singh-ebs-oracle cloud(iaas+paas)veshaal-singh-ebs-oracle cloud(iaas+paas)
veshaal-singh-ebs-oracle cloud(iaas+paas)
aioughydchapter
 
Ebs upgrade-to-12.2 technical-upgrade_best_practices
Ebs upgrade-to-12.2 technical-upgrade_best_practicesEbs upgrade-to-12.2 technical-upgrade_best_practices
Ebs upgrade-to-12.2 technical-upgrade_best_practices
aioughydchapter
 
Implementing cloud applications redefine your dimension
Implementing cloud applications   redefine your dimensionImplementing cloud applications   redefine your dimension
Implementing cloud applications redefine your dimension
aioughydchapter
 
Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_
aioughydchapter
 
Oracle analytics cloud overview feb 2017
Oracle analytics cloud overview   feb 2017Oracle analytics cloud overview   feb 2017
Oracle analytics cloud overview feb 2017
aioughydchapter
 

Viewers also liked (7)

Getting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteGetting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suite
 
Ebs12.2 online patching
Ebs12.2 online patching Ebs12.2 online patching
Ebs12.2 online patching
 
veshaal-singh-ebs-oracle cloud(iaas+paas)
veshaal-singh-ebs-oracle cloud(iaas+paas)veshaal-singh-ebs-oracle cloud(iaas+paas)
veshaal-singh-ebs-oracle cloud(iaas+paas)
 
Ebs upgrade-to-12.2 technical-upgrade_best_practices
Ebs upgrade-to-12.2 technical-upgrade_best_practicesEbs upgrade-to-12.2 technical-upgrade_best_practices
Ebs upgrade-to-12.2 technical-upgrade_best_practices
 
Implementing cloud applications redefine your dimension
Implementing cloud applications   redefine your dimensionImplementing cloud applications   redefine your dimension
Implementing cloud applications redefine your dimension
 
Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_
 
Oracle analytics cloud overview feb 2017
Oracle analytics cloud overview   feb 2017Oracle analytics cloud overview   feb 2017
Oracle analytics cloud overview feb 2017
 

Similar to Indexes overview

Optimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptxOptimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptx
JasonTuran2
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
dpcobb
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL Server
Rajesh Gunasundaram
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
Shehap Elnagar
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersShehap Elnagar
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
Shehap Elnagar
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
Richie Rump
 
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
Carlos Oliveira
 
TAU Performance tool using OpenPOWER
TAU Performance tool using OpenPOWERTAU Performance tool using OpenPOWER
TAU Performance tool using OpenPOWER
Ganesan Narayanasamy
 
Exploring T-SQL Anti-Patterns
Exploring T-SQL Anti-Patterns Exploring T-SQL Anti-Patterns
Exploring T-SQL Anti-Patterns
Antonios Chatzipavlis
 
How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15
oysteing
 
Db2 sql tuning and bmc catalog manager
Db2 sql tuning and bmc catalog manager Db2 sql tuning and bmc catalog manager
Db2 sql tuning and bmc catalog manager
Krishan Singh
 
Improve speed &amp; performance of informix 11.xx part 1
Improve speed &amp; performance of informix 11.xx   part 1Improve speed &amp; performance of informix 11.xx   part 1
Improve speed &amp; performance of informix 11.xx part 1
am_prasanna
 
Sumo Logic Quick Start - Feb 2016
Sumo Logic Quick Start - Feb 2016Sumo Logic Quick Start - Feb 2016
Sumo Logic Quick Start - Feb 2016
Sumo Logic
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
Dhananjay Goel
 
Sumo Logic QuickStart Webinar July 2016
Sumo Logic QuickStart Webinar July 2016Sumo Logic QuickStart Webinar July 2016
Sumo Logic QuickStart Webinar July 2016
Sumo Logic
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
Nirav Shah
 
How to analyze and tune sql queries for better performance webinar
How to analyze and tune sql queries for better performance webinarHow to analyze and tune sql queries for better performance webinar
How to analyze and tune sql queries for better performance webinar
oysteing
 
Pl sql best practices document
Pl sql best practices documentPl sql best practices document
Pl sql best practices document
Ashwani Pandey
 

Similar to Indexes overview (20)

Optimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptxOptimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptx
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL Server
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
 
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
 
TAU Performance tool using OpenPOWER
TAU Performance tool using OpenPOWERTAU Performance tool using OpenPOWER
TAU Performance tool using OpenPOWER
 
Exploring T-SQL Anti-Patterns
Exploring T-SQL Anti-Patterns Exploring T-SQL Anti-Patterns
Exploring T-SQL Anti-Patterns
 
How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15How to analyze and tune sql queries for better performance percona15
How to analyze and tune sql queries for better performance percona15
 
Db2 sql tuning and bmc catalog manager
Db2 sql tuning and bmc catalog manager Db2 sql tuning and bmc catalog manager
Db2 sql tuning and bmc catalog manager
 
Improve speed &amp; performance of informix 11.xx part 1
Improve speed &amp; performance of informix 11.xx   part 1Improve speed &amp; performance of informix 11.xx   part 1
Improve speed &amp; performance of informix 11.xx part 1
 
Sumo Logic Quick Start - Feb 2016
Sumo Logic Quick Start - Feb 2016Sumo Logic Quick Start - Feb 2016
Sumo Logic Quick Start - Feb 2016
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Sumo Logic QuickStart Webinar July 2016
Sumo Logic QuickStart Webinar July 2016Sumo Logic QuickStart Webinar July 2016
Sumo Logic QuickStart Webinar July 2016
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
How to analyze and tune sql queries for better performance webinar
How to analyze and tune sql queries for better performance webinarHow to analyze and tune sql queries for better performance webinar
How to analyze and tune sql queries for better performance webinar
 
Pl sql best practices document
Pl sql best practices documentPl sql best practices document
Pl sql best practices document
 

More from aioughydchapter

Role of DBAs in CLOUD ERA - AIOUG Hyd Chapter - Oracle Cloud Day
Role of DBAs in CLOUD ERA - AIOUG Hyd Chapter - Oracle Cloud DayRole of DBAs in CLOUD ERA - AIOUG Hyd Chapter - Oracle Cloud Day
Role of DBAs in CLOUD ERA - AIOUG Hyd Chapter - Oracle Cloud Day
aioughydchapter
 
Oracle Cloud Day(IaaS, PaaS,SaaS) - AIOUG Hyd Chapter
Oracle Cloud Day(IaaS, PaaS,SaaS) - AIOUG Hyd ChapterOracle Cloud Day(IaaS, PaaS,SaaS) - AIOUG Hyd Chapter
Oracle Cloud Day(IaaS, PaaS,SaaS) - AIOUG Hyd Chapter
aioughydchapter
 
Oracle rac cachefusion - High Availability Day 2015
Oracle rac cachefusion - High Availability Day 2015Oracle rac cachefusion - High Availability Day 2015
Oracle rac cachefusion - High Availability Day 2015
aioughydchapter
 
Dmz aa aioug
Dmz aa aiougDmz aa aioug
Dmz aa aioug
aioughydchapter
 
Editioning use in ebs
Editioning use in  ebsEditioning use in  ebs
Editioning use in ebs
aioughydchapter
 
Query optimizer vivek sharma
Query optimizer vivek sharmaQuery optimizer vivek sharma
Query optimizer vivek sharma
aioughydchapter
 
Performance tuning intro
Performance tuning introPerformance tuning intro
Performance tuning intro
aioughydchapter
 

More from aioughydchapter (7)

Role of DBAs in CLOUD ERA - AIOUG Hyd Chapter - Oracle Cloud Day
Role of DBAs in CLOUD ERA - AIOUG Hyd Chapter - Oracle Cloud DayRole of DBAs in CLOUD ERA - AIOUG Hyd Chapter - Oracle Cloud Day
Role of DBAs in CLOUD ERA - AIOUG Hyd Chapter - Oracle Cloud Day
 
Oracle Cloud Day(IaaS, PaaS,SaaS) - AIOUG Hyd Chapter
Oracle Cloud Day(IaaS, PaaS,SaaS) - AIOUG Hyd ChapterOracle Cloud Day(IaaS, PaaS,SaaS) - AIOUG Hyd Chapter
Oracle Cloud Day(IaaS, PaaS,SaaS) - AIOUG Hyd Chapter
 
Oracle rac cachefusion - High Availability Day 2015
Oracle rac cachefusion - High Availability Day 2015Oracle rac cachefusion - High Availability Day 2015
Oracle rac cachefusion - High Availability Day 2015
 
Dmz aa aioug
Dmz aa aiougDmz aa aioug
Dmz aa aioug
 
Editioning use in ebs
Editioning use in  ebsEditioning use in  ebs
Editioning use in ebs
 
Query optimizer vivek sharma
Query optimizer vivek sharmaQuery optimizer vivek sharma
Query optimizer vivek sharma
 
Performance tuning intro
Performance tuning introPerformance tuning intro
Performance tuning intro
 

Recently uploaded

Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

Indexes overview

  • 1. © Copyright 2015. Apps Associates LLC. 1 Performance Tuning Overview March 30, 2015
  • 2. © Copyright 2015. Apps Associates LLC. 2 Indexing
  • 3. © Copyright 2015. Apps Associates LLC. 3 0..50 51..100 101..150 …. 10000.. 10050 0..10 11..19 20..25 …. 47.. 50 51..58 59..63 64..75 …. 98.. 100 10000.. 10009 10010.. 10020 10021..10028 … 10046..10050 0,rowid 0,rowid 1,rowid …. 10,rowid 11,rowid 11,rowid 12,rowid …. 19,rowid 10046,rowid 10048,rowid 10048,rowid …. 10050,rowid …. …. 10021,rowid 10022,rowid 10023,rowid …. 10028,rowid …. Create index I on T(numColumn)
  • 4. © Copyright 2015. Apps Associates LLC. 4 B*Tree When to use • CLUSTERING FACTOR – A measure of how sorted the table is by the key in the index – It measures how many IO’s it would take to read the entire table via the index – row after row after row – If table is sorted by key, clustering factor near number of blocks in the table. – If table is not sorted by key, clustering factor nearer number of ROWS in table. – Please ask yourself, how many ways can the table be sorted on disk?
  • 5. © Copyright 2015. Apps Associates LLC. 5 1,Alice 2,Bob 3,Candy 4,Doug 5,Ellen 6,Frank 7,George 8,Hank …. …. …. …. …. … … … … … …. 0..50 51..100 101..150 …. 10000.. 100500..10 11..19 20..25 …. 47.. 50 51..58 59..63 64..75 …. 98.. 100 10000.. 10009 10010.. 10020 10021..10028 … 10046..10050 …. Create index nm_idx on name) Select * from t where pk between 1 and 8 Pk Name 1 Alice 2 Sue 3 Victor 4 Will Pk Name 5 Irene 6 Kelly 7 Melanie 8 Oliver Pk Name 9 George 10 Candy 11 Uwe 12 Wally Pk Name 13 Ellen 14 Tom 15 Rick 16 Paul Pk Name 17 Doug 18 Irene 19 Lance 20 Jack Pk Name 21 Hank 22 Frank 23 Nicole 24 Bob
  • 6. © Copyright 2015. Apps Associates LLC. 6 1,Alice 2,Bob 3,Candy 4,Doug 5,Ellen 6,Frank 7,George 8,Hank …. …. …. …. …. … … … … … …. 0..50 51..100 101..150 …. 10000.. 100500..10 11..19 20..25 …. 47.. 50 51..58 59..63 64..75 …. 98.. 100 10000.. 10009 10010.. 10020 10021..10028 … 10046..10050 …. Create index nm_idx on name) Select * from t where Name between ‘Alice’ and ‘Hank’ Pk Name 1 Alice 2 Sue 3 Victor 4 Will Pk Name 5 Irene 6 Kelly 7 Melanie 8 Oliver Pk Name 9 George 10 Candy 11 Uwe 12 Wally Pk Name 13 Ellen 14 Tom 15 Rick 16 Paul Pk Name 17 Doug 18 Irene 19 Lance 20 Jack Pk Name 21 Hank 22 Frank 23 Nicole 24 Bob
  • 7. Access paths – Getting the data Access Path Explanation Full table scan Reads all rows from table & filters out those that do not meet the where clause predicates. Used when no index, DOP set etc Table access by Rowid Rowid specifies the datafile & data block containing the row and the location of the row in that block. Used if rowid supplied by index or in where clause Index unique scan Only one row will be returned. Used when stmt contains a UNIQUE or a PRIMARY KEY constraint that guarantees that only a single row is accessed Index range scan Accesses adjacent index entries returns ROWID values Used with equality on non-unique indexes or range predicate on unique index (<.>, between etc) Index skip scan Skips the leading edge of the index & uses the rest Advantageous if there are few distinct values in the leading column and many distinct values in the non-leading column Full index scan Processes all leaf blocks of an index, but only enough branch blocks to find 1st leaf block. Used when all necessary columns are in index & order by clause matches index struct or if sort merge join is done Fast full index scan Scans all blocks in index used to replace a FTS when all necessary columns are in the index. Using multi-block IO & can going parallel Index joins Hash join of several indexes that together contain all the table columns that are referenced in the query. Wont eliminate a sort operation Bitmap indexes uses a bitmap for key values and a mapping function that converts each bit position to a rowid. Can efficiently merge indexes that correspond to several conditions in a WHERE clause
  • 8. © Copyright 2015. Apps Associates LLC. 8 Reverse Key Index • Physically stores the bytes of the keys in reverse order • In general, typically prevents range scanning – 5 is not stored next to 6 is not stored next to 7… • Used to avoid “hot block syndrome” • Can also be used to avoid having to re-organize a ‘sweeping’ index
  • 9. © Copyright 2015. Apps Associates LLC. 9 Reverse Key Index - performance • It can help with buffer busy waits – On monotonically increasing values – Eg: sequence populated fields – Eg: date/timestamp fields • Especially in a clustered environment, this can reduce latency • At the cost of additional CPU – Evident mostly in single user mode – When you go multi-user, because you are not spinning on a buffer wait, you see less overall CPU
  • 10. © Copyright 2015. Apps Associates LLC. 10 Reverse Key Index - performance • PL/SQL still more efficient • Reverse Key index has measurable impact for PL/SQL Single User PL/SQL Pro*C Reverse No Reverse Reverse No Reverse Transaction/second 38.24 43.45 17.35 19.08 CPU time (seconds) 25 22 33 31 Buffer busy waits number/time 0/0 0/0 0/0 0/0 Elapsed time (minutes) 0.42 0.37 0.92 0.83 Log file sync number/time 6/0 1,940/7 1,940/7
  • 11. © Copyright 2015. Apps Associates LLC. 11 Reverse Key Index - performance Transaction/second 46.59 49.03 20.07 20.29 CPU time (seconds) 77 73 104 101 Buffer busy waits number/time 4,267/2 133,644/2 3,286/0 23,688/1 Elapsed time (minutes) 0.68 0.65 1.58 1.57 Log file sync number/time 19/0 18/0 3,273/29 2,132/29 PL/SQL Pro*C Reverse No Reverse Reverse No Reverse • PL/SQL still more efficient • Reverse Key index has measurable impact for PL/SQL in this case Two Users
  • 12. © Copyright 2015. Apps Associates LLC. 12 Reverse Key Index - performance PL/SQL still more efficient Reverse Key index has impressively measurable effect As we scale up – this will have more of an impact At low concurrency, little impact Ten Users PL/SQL Pro*C Reverse No Reverse Reverse No Reverse Transaction/second 45.90 35.38 17.88 16.05 CPU time (seconds) 781 789 1,256 1,384 Buffer busy waits number/time 26k/279 456k/1,382 25k/134 364k/1702 Elapsed time (minutes) 3.47 4.50 8.90 9.92 Log file sync number/time 2,602/72 11k/196 12k/141
  • 13. What basic statistics to collect • By default the following basic table & column statistic are collected – Number of Rows – Number of blocks – Average row length – Number of distinct values – Number of nulls in column
  • 14. What basic statistics to collect • Index statistics are automatically gathered during creation and maintained by GATHER_TABLE_STATS and include – Number of leaf blocks – Branch Levels – Clustering factor • 12c – Tables have basic statistics gathered during loads into empty segments too
  • 15. What basic statistics to collect • Histograms tell Optimizer about the data distribution in a Column • Creation controlled by METHOD_OPT parameter • Default create histogram on any column that has been used in the WHERE clause or GROUP BY of a statement AND has a data skew • Relies on column usage information gathered at compilation time and stored in SYS.COL_USAGE$ Histograms
  • 16. What basic statistics to collect • 11g and before - Two types of histograms – Frequency – Height-balanced • 12c and after – two more – Top Frequency – Hybrid Histograms
  • 17. Histograms • A frequency histogram is only created if the number of distinct values in a column (NDV) is less than 254 values Frequency histograms (FREQUENCY) Frequency histogram
  • 18. Histograms • A height balanced histogram is created if the number of distinct values in a column (NDV) is greater than 254 values Height balanced histograms (HEIGHT BALANCED) Height balanced histogram
  • 19. Histograms • Traditionally a frequency histogram is only created if NDV < 254 • But if a small number of values occupies most of the rows (>99% rows) • Creating a frequency histograms on that small set of values is very useful even though NDV is greater than 254 • Ignores the unpopular values to create a better quality histogram for popular values • Built using the same technique used for frequency histograms • Only created with AUTO_SAMPLE_SIZE Top Frequency (TOP-FREQUENCY) 12c
  • 20. Histograms • Similar to height balanced histogram as created if the NDV >254 • Store the actual frequencies of bucket endpoints in histograms • No values are allowed to spill over multiple buckets • More endpoint values can be squeezed in a histogram • Achieves the same effect as increasing the # of buckets • Only created with AUTO_SAMPLE_SIZE Hybrid Histograms (HYBRID) 12c
  • 21. © Copyright 2015. Apps Associates LLC. 21