SlideShare a Scribd company logo
1 of 31
Download to read offline
Why You May Not Need Offloading
Presented by: Alex Fatkulin
Senior Consultant
January 20, 2013
Who am I ?
 Senior Technical Consultant at Enkitec

 12 years using Oracle
 Clustered and HA solutions
 Database Development and Design
 Technical Reviewer
 Blog at http://afatkulin.blogspot.com

3
Why This Presentation?

4
Sounds familiar?

(tongue in cheek)

 My SQL is slow but it’s offload ratio is 95%+
 This just can’t be!

 My SQL is slow and it must be because it has a low
offload ratio
 This ought to be it!

 Offload ratio is the only thing to worry about
 Nothing else matters!

5
What is offload ratio?
 The amount of work performed on the storage cells
relative to the total amount of work

𝑊(𝐶𝐸𝐿𝐿)
𝑅=
𝑊 𝐶𝐸𝐿𝐿 + 𝑊(𝑅𝐷𝐵𝑀𝑆)

6
I/O Saved (MOS)
 MOS Doc ID 1438173.1
𝐼𝑂_𝑆𝐴𝑉𝐸𝐷 =

𝐼𝑂_𝐶𝐸𝐿𝐿_𝑂𝐹𝐹𝐿𝑂𝐴𝐷_𝐸𝐿𝐼𝐺𝐼𝐵𝐿𝐸_𝐵𝑌𝑇𝐸𝑆 − 𝐼𝑂_𝐼𝑁𝑇𝐸𝑅𝐶𝑂𝑁𝑁𝐸𝐶𝑇_𝐵𝑌𝑇𝐸𝑆
𝐼𝑂_𝐶𝐸𝐿𝐿_𝑂𝐹𝐹𝐿𝑂𝐴𝐷_𝐸𝐿𝐼𝐺𝐼𝐵𝐿𝐸_𝐵𝑌𝑇𝐸𝑆
=1 −

𝐼𝑂_𝐼𝑁𝑇𝐸𝑅𝐶𝑂𝑁𝑁𝐸𝐶𝑇_𝐵𝑌𝑇𝐸𝑆
𝐼𝑂_𝐶𝐸𝐿𝐿_𝑂𝐹𝐹𝐿𝑂𝐴𝐷_𝐸𝐿𝐼𝐺𝐼𝐵𝐿𝐸_𝐵𝑌𝑇𝐸𝑆

 IO_INTERCONNECT_BYTES
 Includes all types of I/O against any storage
 Includes mirrored data
 Compressed vs Uncompressed data

7
Cell Offload Efficiency (SQLMON)
 SQL Monitor

C=1 −

𝐼𝑂_𝐼𝑁𝑇𝐸𝑅𝐶𝑂𝑁𝑁𝐸𝐶𝑇_𝐵𝑌𝑇𝐸𝑆
𝑃𝐻𝑌𝑆𝐼𝐶𝐴𝐿_𝑅𝐸𝐴𝐷_𝐵𝑌𝑇𝐸𝑆 + 𝑃𝐻𝑌𝑆𝐼𝐶𝐴𝐿_𝑊𝑅𝐼𝑇𝐸_𝐵𝑌𝑇𝐸𝑆

 Only considers data volumes

8
Offload Ratio
 Two SQL statements return the same data but have
different plans and offload ratios
SQL Statement

Offload ratio
A

90%

B

0%

 Which one is better?

9
Offload Ratio
 Two SQL statements return the same data but have
different plans and offload ratios
SQL Statement

Offload ratio

Scanned

Returned

A

90%

100GB

10GB

B

0%

10GB

10GB

 Using offload ratio alone is unreliable indicator for
performance

10
90% Offload Ratio
SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’

100%

CELLSRV
10% (STATE=‘NJ’)

RDBMS

11
90% Offload Ratio
SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’

100%

CELLSRV
10%

DISCARDED

90%

RDBMS

12
90% Offload Ratio
SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’

100% (input)

CELLSRV
10%
(output)

DISCARDED

90%
(overhead)

RDBMS

13
Offload Ratio
 What if we partition the table?
create table trans_data
(
...
state varchar2(2),
...
) partition by list (state)
(
...
partition NJ values ('NJ'),
partition NY values ('NY'),
...
);

14
0% Offload Ratio
SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’

100% (input)

Eliminated by Partition Pruning

CELLSRV
100%
(output)

NOTHING DISCARDED

0%
(overhead)

RDBMS

15
Cell Offload Efficiency (SQLMON)
SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’

C=1 −

𝐼𝑂_𝐼𝑁𝑇𝐸𝑅𝐶𝑂𝑁𝑁𝐸𝐶𝑇_𝐵𝑌𝑇𝐸𝑆
𝑃𝐻𝑌𝑆𝐼𝐶𝐴𝐿_𝑅𝐸𝐴𝐷_𝐵𝑌𝑇𝐸𝑆 + 𝑃𝐻𝑌𝑆𝐼𝐶𝐴𝐿_𝑊𝑅𝐼𝑇𝐸_𝐵𝑌𝑇𝐸𝑆

→1−

OUTPUT
INPUT

 Efficiency

 Overhead

16
Data Selectivity
 Selective data – data SQL statement needs for the final
result
 Unselective data – data SQL statement has to go through
SQL

Input

Output

Data Selectivity

A

100GB

10GB

10%

B

10GB

10GB

100%

17
Data Selectivity and Exadata
 Data selective query beats data unselective query any day of the
week (all other things equal)
 Data unselective queries tend to benefit the most from the Exadata
Response Time %
SQL A Exadata
SQL A
SQL B Exadata
SQL B
0

10

20

30

40

Unselective Data

50

60

70

80

90

100

Selective Data

18
Exadata Design Disaster

The easiest way to archive high offload ratios is to make
all your SQLs to be very data unselective

19
The Year is 2001…

20
The Year is 2001…
“Buffer Cache Hit Ratio Tuning is
Rampant…”

21
The Year is 2001…
 Why a 99%+ Database Buffer Cache Hit Ratio is NOT Ok (*)
 Cary Millsap/Hotsos Enterprises Ltd.

(*) used here with Cary’s permission
22
The Year is 2001…
“Database buffer cache hit ratios are
useless!!!”

23
Buffer Cache Hit Ratio
 One of the major ratios used to tune databases

 Displayed on the “front page” of most database tools
(Quest Spotlight, Oracle OEM, etc.)
 Choose any hit ratio (why BCHR is useless):
http://www.oracledba.co.uk/tips/choose.htm
 It took 10+ years to deal with it

24
Bump Your Offload Ratio
If you’re still unconvinced…

25
Bump Your Offload Ratio
 Improves your offload ratio to 99%+ percent!!! (*)
--One time setup
create table bump_my_offload nocompress as
select rpad('x', 4000, 'x') x
from dual
connect by level <= 200000;
--Main Loop
begin
execute immediate 'alter session set parallel_degree_policy=manual';
execute immediate 'alter session set "_parallel_cluster_cache_policy"=adaptive';
execute immediate 'alter session set "_kcfis_storageidx_disabled"=true';
loop
for cur in (select /*+ parallel(16) */ * from bump_my_offload where x is null)
loop
null;
end loop;
end loop;
end;

(*) if you don’t archive 99%+ offload ratio simply run more
copies of the “Main Loop” in parallel
26
Limitations

27
Data Processing
SELECT STATE, STORE_ID, DATE_ID, SUM(AMOUNT), COUNT(DISTINCT CART_ID)
FROM TRANS_DATA
GROUP BY STATE, STORE_ID, DATE_ID

CPU

User I/O

Raw Data Processing

Aggregation
Processing

Raw Data Processing Exadata

28
Data Processing
SELECT STATE, STORE_ID, DATE_ID, SUM(AMOUNT), COUNT(DISTINCT CART_ID)
FROM TRANS_DATA
GROUP BY STATE, STORE_ID, DATE_ID

29
Trade-Offs

30
Trade-Offs
 In-Memory PQ
 Does not work with smart scans (no direct path reads)

 Segment-level checkpoints
 Can introduce significant overhead

 OLTP activity
 Often does not mix well with smart scans

 In-memory database option
 Not in offloading territory

31
Q&A
Email: afatkulin@enkitec.com
Blog: http://afatkulin.blogspot.com

32

More Related Content

Similar to Why You May Not Need Offloading

Advanced tips of dbms statas
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statas
Louis liu
 

Similar to Why You May Not Need Offloading (20)

Performance Tuning Using oratop
Performance Tuning Using oratop Performance Tuning Using oratop
Performance Tuning Using oratop
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
Jdbc ja
Jdbc jaJdbc ja
Jdbc ja
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Fast and Furious: Handling Edge Computing Data With Oracle 19c Fast Ingest an...
Fast and Furious: Handling Edge Computing Data With Oracle 19c Fast Ingest an...Fast and Furious: Handling Edge Computing Data With Oracle 19c Fast Ingest an...
Fast and Furious: Handling Edge Computing Data With Oracle 19c Fast Ingest an...
 
Dependable Systems - Structure-Based Dependabiilty Modeling (6/16)
Dependable Systems - Structure-Based Dependabiilty Modeling (6/16)Dependable Systems - Structure-Based Dependabiilty Modeling (6/16)
Dependable Systems - Structure-Based Dependabiilty Modeling (6/16)
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
 
Oracle Database performance tuning using oratop
Oracle Database performance tuning using oratopOracle Database performance tuning using oratop
Oracle Database performance tuning using oratop
 
Performance tuning
Performance tuningPerformance tuning
Performance tuning
 
Oracle Database In-Memory Option in Action
Oracle Database In-Memory Option in ActionOracle Database In-Memory Option in Action
Oracle Database In-Memory Option in Action
 
Applying profilers to my sql (fosdem 2017)
Applying profilers to my sql (fosdem 2017)Applying profilers to my sql (fosdem 2017)
Applying profilers to my sql (fosdem 2017)
 
Cluster Health Advisor (CHA) Deep Dive by Mark Scardina
Cluster Health Advisor (CHA)  Deep Dive by Mark ScardinaCluster Health Advisor (CHA)  Deep Dive by Mark Scardina
Cluster Health Advisor (CHA) Deep Dive by Mark Scardina
 
Advanced tips of dbms statas
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statas
 
Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolest
 
Long live to CMAN!
Long live to CMAN!Long live to CMAN!
Long live to CMAN!
 
Why is my_oracle_e-biz_database_slow_a_million_dollar_question
Why is my_oracle_e-biz_database_slow_a_million_dollar_questionWhy is my_oracle_e-biz_database_slow_a_million_dollar_question
Why is my_oracle_e-biz_database_slow_a_million_dollar_question
 
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)
RMOUG2016 - Resource Management (the critical piece of the consolidation puzzle)
 

More from Enkitec

Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
Enkitec
 
APEX Security Primer
APEX Security PrimerAPEX Security Primer
APEX Security Primer
Enkitec
 
How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?
Enkitec
 
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Enkitec
 
Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)
Enkitec
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
Enkitec
 
Fatkulin hotsos 2014
Fatkulin hotsos 2014Fatkulin hotsos 2014
Fatkulin hotsos 2014
Enkitec
 
Combining ACS Flexibility with SPM Stability
Combining ACS Flexibility with SPM StabilityCombining ACS Flexibility with SPM Stability
Combining ACS Flexibility with SPM Stability
Enkitec
 

More from Enkitec (20)

Using Angular JS in APEX
Using Angular JS in APEXUsing Angular JS in APEX
Using Angular JS in APEX
 
Controlling execution plans 2014
Controlling execution plans   2014Controlling execution plans   2014
Controlling execution plans 2014
 
Engineered Systems: Environment-as-a-Service Demonstration
Engineered Systems: Environment-as-a-Service DemonstrationEngineered Systems: Environment-as-a-Service Demonstration
Engineered Systems: Environment-as-a-Service Demonstration
 
Think Exa!
Think Exa!Think Exa!
Think Exa!
 
In Search of Plan Stability - Part 1
In Search of Plan Stability - Part 1In Search of Plan Stability - Part 1
In Search of Plan Stability - Part 1
 
Mini Session - Using GDB for Profiling
Mini Session - Using GDB for ProfilingMini Session - Using GDB for Profiling
Mini Session - Using GDB for Profiling
 
Profiling Oracle with GDB
Profiling Oracle with GDBProfiling Oracle with GDB
Profiling Oracle with GDB
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
SQL Tuning Tools of the Trade
SQL Tuning Tools of the TradeSQL Tuning Tools of the Trade
SQL Tuning Tools of the Trade
 
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan Stability
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan StabilityUsing SQL Plan Management (SPM) to Balance Plan Flexibility and Plan Stability
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan Stability
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
 
APEX Security Primer
APEX Security PrimerAPEX Security Primer
APEX Security Primer
 
How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?
 
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
 
Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
 
Fatkulin hotsos 2014
Fatkulin hotsos 2014Fatkulin hotsos 2014
Fatkulin hotsos 2014
 
Combining ACS Flexibility with SPM Stability
Combining ACS Flexibility with SPM StabilityCombining ACS Flexibility with SPM Stability
Combining ACS Flexibility with SPM Stability
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
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
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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
Safe Software
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Why You May Not Need Offloading

  • 1. Why You May Not Need Offloading Presented by: Alex Fatkulin Senior Consultant January 20, 2013
  • 2. Who am I ?  Senior Technical Consultant at Enkitec  12 years using Oracle  Clustered and HA solutions  Database Development and Design  Technical Reviewer  Blog at http://afatkulin.blogspot.com 3
  • 4. Sounds familiar? (tongue in cheek)  My SQL is slow but it’s offload ratio is 95%+  This just can’t be!  My SQL is slow and it must be because it has a low offload ratio  This ought to be it!  Offload ratio is the only thing to worry about  Nothing else matters! 5
  • 5. What is offload ratio?  The amount of work performed on the storage cells relative to the total amount of work 𝑊(𝐶𝐸𝐿𝐿) 𝑅= 𝑊 𝐶𝐸𝐿𝐿 + 𝑊(𝑅𝐷𝐵𝑀𝑆) 6
  • 6. I/O Saved (MOS)  MOS Doc ID 1438173.1 𝐼𝑂_𝑆𝐴𝑉𝐸𝐷 = 𝐼𝑂_𝐶𝐸𝐿𝐿_𝑂𝐹𝐹𝐿𝑂𝐴𝐷_𝐸𝐿𝐼𝐺𝐼𝐵𝐿𝐸_𝐵𝑌𝑇𝐸𝑆 − 𝐼𝑂_𝐼𝑁𝑇𝐸𝑅𝐶𝑂𝑁𝑁𝐸𝐶𝑇_𝐵𝑌𝑇𝐸𝑆 𝐼𝑂_𝐶𝐸𝐿𝐿_𝑂𝐹𝐹𝐿𝑂𝐴𝐷_𝐸𝐿𝐼𝐺𝐼𝐵𝐿𝐸_𝐵𝑌𝑇𝐸𝑆 =1 − 𝐼𝑂_𝐼𝑁𝑇𝐸𝑅𝐶𝑂𝑁𝑁𝐸𝐶𝑇_𝐵𝑌𝑇𝐸𝑆 𝐼𝑂_𝐶𝐸𝐿𝐿_𝑂𝐹𝐹𝐿𝑂𝐴𝐷_𝐸𝐿𝐼𝐺𝐼𝐵𝐿𝐸_𝐵𝑌𝑇𝐸𝑆  IO_INTERCONNECT_BYTES  Includes all types of I/O against any storage  Includes mirrored data  Compressed vs Uncompressed data 7
  • 7. Cell Offload Efficiency (SQLMON)  SQL Monitor C=1 − 𝐼𝑂_𝐼𝑁𝑇𝐸𝑅𝐶𝑂𝑁𝑁𝐸𝐶𝑇_𝐵𝑌𝑇𝐸𝑆 𝑃𝐻𝑌𝑆𝐼𝐶𝐴𝐿_𝑅𝐸𝐴𝐷_𝐵𝑌𝑇𝐸𝑆 + 𝑃𝐻𝑌𝑆𝐼𝐶𝐴𝐿_𝑊𝑅𝐼𝑇𝐸_𝐵𝑌𝑇𝐸𝑆  Only considers data volumes 8
  • 8. Offload Ratio  Two SQL statements return the same data but have different plans and offload ratios SQL Statement Offload ratio A 90% B 0%  Which one is better? 9
  • 9. Offload Ratio  Two SQL statements return the same data but have different plans and offload ratios SQL Statement Offload ratio Scanned Returned A 90% 100GB 10GB B 0% 10GB 10GB  Using offload ratio alone is unreliable indicator for performance 10
  • 10. 90% Offload Ratio SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’ 100% CELLSRV 10% (STATE=‘NJ’) RDBMS 11
  • 11. 90% Offload Ratio SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’ 100% CELLSRV 10% DISCARDED 90% RDBMS 12
  • 12. 90% Offload Ratio SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’ 100% (input) CELLSRV 10% (output) DISCARDED 90% (overhead) RDBMS 13
  • 13. Offload Ratio  What if we partition the table? create table trans_data ( ... state varchar2(2), ... ) partition by list (state) ( ... partition NJ values ('NJ'), partition NY values ('NY'), ... ); 14
  • 14. 0% Offload Ratio SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’ 100% (input) Eliminated by Partition Pruning CELLSRV 100% (output) NOTHING DISCARDED 0% (overhead) RDBMS 15
  • 15. Cell Offload Efficiency (SQLMON) SELECT * FROM TRANS_DATA WHERE STATE=‘NJ’ C=1 − 𝐼𝑂_𝐼𝑁𝑇𝐸𝑅𝐶𝑂𝑁𝑁𝐸𝐶𝑇_𝐵𝑌𝑇𝐸𝑆 𝑃𝐻𝑌𝑆𝐼𝐶𝐴𝐿_𝑅𝐸𝐴𝐷_𝐵𝑌𝑇𝐸𝑆 + 𝑃𝐻𝑌𝑆𝐼𝐶𝐴𝐿_𝑊𝑅𝐼𝑇𝐸_𝐵𝑌𝑇𝐸𝑆 →1− OUTPUT INPUT  Efficiency  Overhead 16
  • 16. Data Selectivity  Selective data – data SQL statement needs for the final result  Unselective data – data SQL statement has to go through SQL Input Output Data Selectivity A 100GB 10GB 10% B 10GB 10GB 100% 17
  • 17. Data Selectivity and Exadata  Data selective query beats data unselective query any day of the week (all other things equal)  Data unselective queries tend to benefit the most from the Exadata Response Time % SQL A Exadata SQL A SQL B Exadata SQL B 0 10 20 30 40 Unselective Data 50 60 70 80 90 100 Selective Data 18
  • 18. Exadata Design Disaster The easiest way to archive high offload ratios is to make all your SQLs to be very data unselective 19
  • 19. The Year is 2001… 20
  • 20. The Year is 2001… “Buffer Cache Hit Ratio Tuning is Rampant…” 21
  • 21. The Year is 2001…  Why a 99%+ Database Buffer Cache Hit Ratio is NOT Ok (*)  Cary Millsap/Hotsos Enterprises Ltd. (*) used here with Cary’s permission 22
  • 22. The Year is 2001… “Database buffer cache hit ratios are useless!!!” 23
  • 23. Buffer Cache Hit Ratio  One of the major ratios used to tune databases  Displayed on the “front page” of most database tools (Quest Spotlight, Oracle OEM, etc.)  Choose any hit ratio (why BCHR is useless): http://www.oracledba.co.uk/tips/choose.htm  It took 10+ years to deal with it 24
  • 24. Bump Your Offload Ratio If you’re still unconvinced… 25
  • 25. Bump Your Offload Ratio  Improves your offload ratio to 99%+ percent!!! (*) --One time setup create table bump_my_offload nocompress as select rpad('x', 4000, 'x') x from dual connect by level <= 200000; --Main Loop begin execute immediate 'alter session set parallel_degree_policy=manual'; execute immediate 'alter session set "_parallel_cluster_cache_policy"=adaptive'; execute immediate 'alter session set "_kcfis_storageidx_disabled"=true'; loop for cur in (select /*+ parallel(16) */ * from bump_my_offload where x is null) loop null; end loop; end loop; end; (*) if you don’t archive 99%+ offload ratio simply run more copies of the “Main Loop” in parallel 26
  • 27. Data Processing SELECT STATE, STORE_ID, DATE_ID, SUM(AMOUNT), COUNT(DISTINCT CART_ID) FROM TRANS_DATA GROUP BY STATE, STORE_ID, DATE_ID CPU User I/O Raw Data Processing Aggregation Processing Raw Data Processing Exadata 28
  • 28. Data Processing SELECT STATE, STORE_ID, DATE_ID, SUM(AMOUNT), COUNT(DISTINCT CART_ID) FROM TRANS_DATA GROUP BY STATE, STORE_ID, DATE_ID 29
  • 30. Trade-Offs  In-Memory PQ  Does not work with smart scans (no direct path reads)  Segment-level checkpoints  Can introduce significant overhead  OLTP activity  Often does not mix well with smart scans  In-memory database option  Not in offloading territory 31