Oracle Scratchpad

March 18, 2007

Thinking Big

Filed under: Indexing, Infrastructure, Tuning — Jonathan Lewis @ 9:38 pm UTC Mar 18,2007

This question came up recently on the Oracle-L list-server

We need to store approx. 300 GB of data a month. It will be an OLTP system. We want to use commodity hardware and open source database. We are willing to sacrifice performance for cost. e.g. a single row search from 2 billion rows table should be returned in 2 sec.

(more…)

March 14, 2007

How parallel

Filed under: Execution plans, Parallel Execution, Troubleshooting, trace files — Jonathan Lewis @ 7:16 am UTC Mar 14,2007

Or as Doug Burns put it on his blog: how can I tell the actual DOP used for my parallel query”

As Doug points out, you first have to ask “When are you asking the question”. Immediately after you have run the query you could check v$pq_tqstat to see what happened, but apart from that you have  very little hope of finding out in retrospect what happened in a specific query. 

(more…)

March 12, 2007

Methods

Filed under: Troubleshooting — Jonathan Lewis @ 9:52 pm UTC Mar 12,2007

The following question appeared a little while ago on comp.databases.oracle.server, with reference to Oracle 10.2.0.1:


drop table t1 purge;        

create table t1
as
select * from all_objects;         

create index t1_fbi1 on t1(lower(object_name));
create index t1_i1   on t1(object_name);         

-- now generate statistics

(more…)

March 9, 2007

Push_Subq

Filed under: CBO, Execution plans, Hints, Troubleshooting, Tuning — Jonathan Lewis @ 2:08 pm UTC Mar 9,2007

Another little warning for those about to upgrade from 9i to 10g. Some hints will change their behaviour. Consider the following SQL.
(more…)

March 8, 2007

Transformation and Optimisation

Filed under: CBO, Performance, Tuning — Jonathan Lewis @ 1:33 pm UTC Mar 8,2007

One of the biggest changes in the optimizer in 10g is the arrival of cost-based query transformation.

In earlier versions of Oracle, it was possible to distinguish very clearly between “transformation” and “optimisation”. The transformation engine would accept your SQL, and follow a set of rules to produce a restuctured statement that was logically equivalent but easier for the optimisation engine to handle.

(more…)

March 7, 2007

Analysing Statspack (4)

Filed under: Statspack, Troubleshooting — Jonathan Lewis @ 4:38 am UTC Mar 7,2007

[Back to Part 3] [Forward to part 5]

One of the ways to use statspack is to extract trending information from the data. I published some sample SQL on my website a couple of years ago to show how this could be done – but there are alternatives.

(more…)

March 5, 2007

Web Presentation

Filed under: CBO, Execution plans, Hints, Tuning — Jonathan Lewis @ 11:45 pm UTC Mar 5,2007

A few days ago, I recorded a Web presentation at Oracle’s offices in Reading. The topic I chose was the one that I ‘ve just repeated at the Hotsos 2007 event: dissecting one query to see how much you can learn about how the optimizer works, and how you have to think when dealing with a difficult problem in SQL.

The entire presentation – one hour long, audio synchronised with slide-show as a Macromedia Breeze presentation – can be heard at this rather long URL

The generic structure of the query used in the presentation was the one I first introduced in the blog item about Join Orders.

 

Ordering

Filed under: CBO, Execution plans, Performance, Tuning — Jonathan Lewis @ 1:37 pm UTC Mar 5,2007

Here’s a recent question from comp.databases.oracle.server:

Is there any documentation available on the default query result ordering in the absence of an ORDER BY clause? I looked through the Oracle docs and could not find much. I do not plan to depend on this behavior but I am curious on how it works.

(more…)

Blog at WordPress.com.