79

How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best
Page 2: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Real-World Performance SQL Performance

Real-World Performance Team

Page 3: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Introductions

Page 4: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Introductions

• 10 Years at Oracle • Manage Real-World Performance education in China • Learn to analysis from top down, make sure you are on the right direction • Be open and positive, aim high

曲卓 (Christine Qu)

Page 5: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Introductions

• 14 years of Oracle experience • 7 years in RWP • Manage Real-World Performance projects in China

8/10/2015

董志平(Cary Dong)

Page 6: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Real-World Performance

• Part of the Database Development Organization • Global Team located in USA, Europe, Asia • 300+ combined years of Oracle database experience • Innovate to achieve exceptional Database Performance • Our methods:

• Use the product as it was designed to be used • Numerical and logical debugging techniques • Educate others about the best performance methods and techniques • Avoid and eliminate “tuning” by hacking/guessing/luck

Who We Are

Page 7: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Where database user look for performance improvements

Perception

ApplicationAlgorithms andCorrect ProductUsageDatabasePlatform

The best place to look for performance Improvements

8/10/2015

The Real World Performance Perception Problem

Reality

ApplicationAlgorithms andCorrect ProductUsageDatabasePlatform

Page 8: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Why is My SQL Slow ?

Page 9: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Problem Query

Table has 1B rows and is 55 GB.

Page 10: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Problem Query

Query 1 consists of two subqueries. The first subquery finds all of the Ferraris.

Page 11: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Problem Query

The second subquery finds all of the Ferrari 458s.

Page 12: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Problem Query

Outer query joins the results of the subqueries.

Outer query performs aggregations.

Page 13: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Problem Query

Query 2 is the same but has different predicate values.

Page 14: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Default Statistics

Page 15: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Default Statistics

Query 1 takes 40 seconds with default statistics

Page 16: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Default Statistics

Page 17: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Default Statistics

Query 2 takes 3 seconds with default statistics

Page 18: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Default Statistics

Page 19: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Baseline Performance for Query 1 exceeds target

• Baseline Performance for Query 2 meets target

Default Statistics

Page 20: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Initial Optimization Steps—More Predicate Values

Page 21: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

More Predicate Values Increase the list of

predicate values

Now query 1 takes 2 seconds

Page 22: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

More Predicate Values

Page 23: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Query runs faster just by changing the list of values in the select

list

• Plan changed from a broadcast to a hash distribution due to the higher but inaccurate cardinality estimate

• Get correct plan with wrong cardinality estimate—can lead to inconsistent plans and performance

More Predicate Values

Page 24: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Initial Optimization Steps—Increase Degree of Parallelism

Page 25: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Degree of Parallelism

Change DoP from 32 to 128

Now query takes 2 seconds

Page 26: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Degree of Parallelism

Page 27: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Changing DoP from 32 to 128 improves performance and meets

the target; 4X more resources yields a 20X performance improvement

• Plan has changed from a broadcast distribution to a hash distribution due to DoP change

• DoP is a resource management technique, not a query tuning tool

Degree of Parallelism

Page 28: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Indexes

Page 29: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings—Indexes Indexes on columns:

• owner_id

• country

• make

• model

• country, make, model

Indexes

Page 30: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Indexes

Add indexes and query takes longer—58 seconds!

Page 31: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Indexes

Index lookups on millions of rows is slow

Query performance varies depending on whether the index is cached or not

Page 32: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings—Indexes • Not understanding the big/little data challenge

• Indexes are not efficient for operations on a large numbers of rows

• Full table scan is faster with predictable performance

Indexes

Page 33: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

To Index or Not

• Indexing is an OLTP technique for operations on a small number of rows • A table scan may consume more resources but it will be predictable no

matter how many rows are returned – Indexes impact DML operations – If I/O bandwidth went from 70MB/sec to 70GB/sec would you change your

optimization/execution strategy?

Page 34: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

To Index or Not

• Index driven query retrieving 1,000,000 rows – Assume the index is cached and the data is not.

• 1,000,000 random IOPS @ 5ms per I/O • This would require 5000 Seconds ( or over 1 hour ) to Execute

– How much data could you scan in 5000 Seconds with a fully sized I/O system able to scan 25 GB/Sec ? • Over 100 TB !

Page 35: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Histograms

Page 36: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Histograms

Rerun stats to get histograms—no change in plan or run time

Page 37: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Histograms

Lots of wait time on temp IO

Page 38: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Re-gathered stats to automatically create histograms

• Frequency histograms on country, make and model columns

• No change in plan—query still exceeds target

Histograms

Page 39: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Flash Temp

Page 40: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Flash Temp

Query time reduced to 23 seconds

Page 41: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Flash Temp Now IO accounts for a

smaller percentage of database time

Page 42: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Most of the wait time was spent performing IO on temp, so move

temp to flash disks

• Improved performance but still does not meet target

• Not a good use of flash

• Incorrect use of tools/products

Flash Temp

Page 43: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Manual Memory Parameters

Page 44: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Manual Memory Parameters

Page 45: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Manual Memory Parameters

Increased memory size manually—now there is no use of temp

Very little IO in database time

Poor cardinality estimate—256K estimated rows vs 40M actual rows

Page 46: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Set sort_area_size and hash_area_size to 2G

• Eliminated temp usage but still did not meet target

• Memory is allocated per parallel server process, which can quickly exceed resources

• Moving to a solution before understanding the problem

Manual Memory Parameters

Page 47: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Cardinality Estimates

Page 48: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Cardinality Estimates

Page 49: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Cardinality Estimates

Use cardinality hint to specify correct number of rows

Plan switches from a broadcast to a hash distribution

Page 50: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Cardinality Hint • SQL Monitor showed poor cardinality estimates

• Cardinality hint gives optimizer the correct number of rows for the table scan

• Plan changed from a broadcast to hash distribution

• Query time now meets target

• Now temp is not an issue

Cardinality Estimates

Page 51: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Disable Broadcast Distribution

Page 52: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Disable Broadcast Distribution

Page 53: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Disable Broadcast Distribution

Disable broadcast distribution and now we have the hash distribution as with the cardinality hint

Page 54: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Google reveals a hidden parameter to disable broadcast

distribution

• Plan and run times are similar to cardinality hint, meeting target

• Moving to a solution before understanding the problem

Disable Broadcast Distribution

Page 55: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Second Query with Broadcast Distribution Disabled

Page 56: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Query 2: Broadcast Distribution Disabled

Page 57: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Query 2: Broadcast Distribution Disabled

Query 2 also uses a hash distribution but no longer meets the target

Page 58: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Plan uses a hash distribution

• Exceeds target

Query 2: Broadcast Distribution Disabled

Page 59: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Second Query with Broadcast Distribution Enabled

Page 60: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Query 2: Broadcast Distribution Enabled

Page 61: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Query 2: Broadcast Distribution Enabled

Reset parameter to enable broadcast distribution—now query 2 uses a broadcast and meets the target

Page 62: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Reset _parallel_broadcast_enabled

• Plan now uses a broadcast distribution

• Meets target

• Should not change system parameters to tune one query

Query 2: Broadcast Distribution Enabled

Page 63: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Extended Stats

Page 64: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Extended Stats

Page 65: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Extended Stats

Created column group but still have a poor cardinality estimate

Page 66: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • High correlation between Country, Make and Model columns

• Created column group

• Query still exceeds target

• Still have poor cardinality estimate

Extended Stats

Page 67: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Histogram on Column Group

Page 68: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Histogram on Column Group

Page 69: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Histogram on Column Group With a histogram on the column group we now have a good cardinality estimate

Now we get a hash distribution and meet the target

Page 70: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings • Re-gathered stats after running the query with the column groups

• Frequency Histogram on the column group

• Accurate cardinality estimates

• Optimizer now uses a hash distribution

Histogram on Column Group

Page 71: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Second Query with Histogram on Column Group

Page 72: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Query 2: Histogram Column Group

Page 73: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Query 2: Histogram Column Group

And uses a broadcast distribution

Query 2 also has a good cardinality estimate

Page 74: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Development Findings •Accurate cardinality estimates

•Optimizer uses a broadcast distribution on second query

Query 2: Histogram Column Group

Page 75: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Now we have the correct solution! • Both queries have good cardinality estimates

• Correct plans

• Meet targets

Histogram on Column Groups

Page 76: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

What Did We Learn?

Page 77: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

• Using DoP for query tuning • Indexes for large data sets • Temp on flash • Forcing use of more memory • Disable broadcast distribution

8/10/2015

Root Causes of Suboptimal Database Performance

Page 78: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Page 79: How to Use the PowerPoint Template - Oracle · SQL Performance . Real-World Performance Team . ... • Numerical and logical debugging techniques • Educate others about the best