Execution Plans

The Impact Of Good Table And Query Design

March 19, 2009
By Greg Rahn

There are many ways to design tables/schemas and many ways to write SQL queries that execute against those tables/schemas. Some designs are better than others for various reasons, however, I think that frequently people underestimate the power of SQL (for both “good” and “evil”). All too often in data warehouses, I see tables designed...
Read more »

Tags: , , , ,
Posted in 11gR1, Data Warehousing, Execution Plans, Oracle, SQL Tuning, VLDB | 7 Comments »

Managing Optimizer Statistics Paper

February 16, 2009
By Greg Rahn
Managing Optimizer Statistics Paper

Over the past couple days I’ve been reading through the recent paper by Karen Morton entitled “Managing Statistics for Optimal Query Performance“. In this paper Karen goes over many of the topics I have discussed as well (and a few that I have not) in the following blog posts: Troubleshooting Bad Execution Plans There...
Read more »

Tags: ,
Posted in Execution Plans, Optimizer, Statistics | 7 Comments »

DBMS_STATS, METHOD_OPT and FOR ALL INDEXED COLUMNS

October 14, 2008
By Greg Rahn

I’ve written before on choosing an optimal stats gathering strategy but I recently came across a scenario that I didn’t directly blog about and think it deserves attention. As I mentioned in that previous post, one should only deviate from the defaults when they have a reason to, and fully understand that reason and...
Read more »

Tags: , , , , , , ,
Posted in 10gR2, 11gR1, Data Warehousing, Execution Plans, Optimizer, Oracle, Performance, SQL Tuning, Statistics, Troubleshooting | 31 Comments »

Automatic DB_FILE_MULTIBLOCK_READ_COUNT

August 14, 2008
By Greg Rahn

Note: Originally this experiment was from a post I wrote on the Oracle Forum: Database – General. I recommend that you read Jonathan Lewis’ summarization of the thread instead of reading all 671 posts (as of today). You will spend much less time and get more out of the discussion. One of the new...
Read more »

Tags: ,
Posted in 11gR1, Data Warehousing, Execution Plans, Optimizer, Oracle, Performance, SQL Tuning, Statistics | 13 Comments »

Oracle 11g: Incremental Global Statistics On Partitioned Tables

July 16, 2008
By Greg Rahn
Oracle 11g: Incremental Global Statistics On Partitioned Tables

Previously I blogged about the new and improved DBMS_STATS.AUTO_SAMPLE_SIZE used to calculate NDV in Oracle 11g and now I wanted to touch on another new feature of DBMS_STATS in 11g: Incremental Global Statistics On Partitioned Tables. Before Incremental Global Stats (Two-Pass Method) When DBMS_STATS.GATHER_TABLE_STATS collects statistics on a partitioned table, generally it does so...
Read more »

Tags: , , , ,
Posted in 10gR2, 11gR1, Data Warehousing, Execution Plans, Optimizer, Oracle, Statistics, Troubleshooting, VLDB | 7 Comments »

Using Bitmap Indexes Effectively

May 29, 2008
By Greg Rahn

Recently I was reading this thread, “Trying to make use of bitmap indexes” on the Oracle Forum. Before I had finished a working example, Jonathan Lewis had posted his response which was on par with my thoughts. Since this is a topic I see frequently, I thought I would finish my experiment and publish...
Read more »

Tags: , , , ,
Posted in 10gR2, 11gR1, Data Warehousing, Execution Plans, Optimizer, Performance, SQL Tuning, Statistics, Troubleshooting, VLDB | 6 Comments »

Null-Aware Anti-Join

May 22, 2008
By Greg Rahn

Recently someone showed me a query execution plan with an operation of HASH JOIN ANTI NA. At first, it was thought maybe it was a bug and the operation had a type-o in it, but after further research it was discovered it was a valid operation and a new cost-based query transformation for subquery...
Read more »

Tags: , , ,
Posted in 10gR2, 11gR1, Data Warehousing, Execution Plans, Optimizer, Oracle, Performance | 7 Comments »

Choosing An Optimal Stats Gathering Strategy

March 26, 2008
By Greg Rahn

Recently the Oracle Optimizer Development Team put out a White Paper entitled Upgrading from Oracle Database 9i to 10g: What to expect from the Optimizer. This paper discusses the main differences between 9i and 10g in the subject area of the Optimizer and Statistics. As G.I. Joe said, “Now we know! And knowing is...
Read more »

Tags: , , , , , , , ,
Posted in 10gR2, Execution Plans, Optimizer, Oracle, Statistics, Troubleshooting | 20 Comments »

There Is No Time Like '%NOW%' To Use Dynamic Sampling

March 5, 2008
By Greg Rahn

I recently came across a query in which the Optimizer was making a poor cardinality estimate, which in turn caused inefficient join type, which in turn caused the query to run excessively long. This post is a reenactment of my troubleshooting. The Suspect SQL The original SQL was quite large and had a fairly...
Read more »

Tags: , , ,
Posted in 10gR2, 11gR1, Data Warehousing, Execution Plans, Optimizer, Oracle, Performance, SQL Tuning, Statistics, VLDB | 11 Comments »

ANSI Outer Joins And Lateral Views

February 18, 2008
By Greg Rahn

A few months ago the Oracle Optimizer Team did a blog post entitled Outerjoins in Oracle. In the Lateral View section of that post they go through some examples and discuss how a query is transformed with the ANSI outer join syntax. I thought it would be useful to go through an example that...
Read more »

Tags: , , ,
Posted in Execution Plans, Optimizer, Oracle, SQL Tuning, Troubleshooting | 18 Comments »

Oracle 11g: Real-Time SQL Monitoring Using DBMS_SQLTUNE.REPORT_SQL_MONITOR

January 6, 2008
By Greg Rahn

Many times a DBA wants to know where a SQL statement is in its execution plan and where the time is being spent. There are a few ways to find out this information, but an 11g new feature makes gathering this information extremely easy. Oracle 11g Real-Time SQL Monitoring allows you to monitor the...
Read more »

Tags: , ,
Posted in 11gR1, Execution Plans, Oracle, Performance, SQL Tuning, Troubleshooting | 18 Comments »

What Are Your System Statistics?

January 2, 2008
By Greg Rahn

I’ve been working on a few test cases and I’m in search of some real-world data. If your production Oracle database uses system statistics, either Workload Statistics or Noworkload Statistics, and you are willing to share them, please post a comment with the output from the following two queries: select version from v$instance; select...
Read more »

Tags: , ,
Posted in 10gR2, 11gR1, Execution Plans, Optimizer, Oracle, Performance, SQL Tuning, Statistics | 32 Comments »