473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Tuning SQL in Oracle

jag
I have some fairly complex queries (joins to 20 tables etc) that run
fine using the rule based optimizer, but simply die using the CBO. Can
anyone offer any hints or point me to a book, web resource, etc. that
will help me tune these correctly using the CBO? I'm using /*+ Rule*/
as a stopgap measure because we're running 8.1.7 right now, but our
move to 9i is coming soon, so I really need to get these running
efficiently using cost based optimization.

Thanks in advance for any help you can offer.

Jul 19 '05 #1
5 3454

Hint:

Analyze all tables and indexes.

http://www.amazon.com/exec/obidos/AS...590327/sr=2-3-
/ref=sr_2_3/103-8017330-2186264

--
Posted via http://dbforums.com
Jul 19 '05 #2
jag
On Wed, 30 Jul 2003 18:46:33 +0000, LKBrwn_DBA
<me*********@dbforums.com> wrote:

Hint:

Analyze all tables and indexes.
That's what got me into this. :) My code starting dragging on our
production database right after a analyze had taken place. Apparently
we were right under a certain level of data before the analyze was run
that the new stats took us past. At that point I guess the CBO chose a
very bad access path.
http://www.amazon.com/exec/obidos/AS...590327/sr=2-3-
/ref=sr_2_3/103-8017330-2186264


Thanks. I just ordered one. This book is a couple of years old though.
Has the CBO changed much for 9i?
Jul 19 '05 #3
Hard to know if we don't see the explain plan and tkprof outputs.(and the
sql)
Jim

"jag" <7b********@sneakemail.com> wrote in message
news:n8********************************@4ax.com...
On Wed, 30 Jul 2003 18:46:33 +0000, LKBrwn_DBA
<me*********@dbforums.com> wrote:

Hint:

Analyze all tables and indexes.


That's what got me into this. :) My code starting dragging on our
production database right after a analyze had taken place. Apparently
we were right under a certain level of data before the analyze was run
that the new stats took us past. At that point I guess the CBO chose a
very bad access path.
http://www.amazon.com/exec/obidos/AS...590327/sr=2-3-
/ref=sr_2_3/103-8017330-2186264


Thanks. I just ordered one. This book is a couple of years old though.
Has the CBO changed much for 9i?

Jul 19 '05 #4
Even if you analyzed all your tables and indices, one more issue you
might want to consider is to create histograms for the (indexed)
columns heavily skewed. They can greatly improve the performance with
the CBO sometimes.

Daniel
On Wed, 30 Jul 2003 18:46:33 +0000, LKBrwn_DBA
<me*********@dbforums.com> wrote:

Hint:

Analyze all tables and indexes.


That's what got me into this. :) My code starting dragging on our
production database right after a analyze had taken place. Apparently
we were right under a certain level of data before the analyze was run
that the new stats took us past. At that point I guess the CBO chose a
very bad access path.
http://www.amazon.com/exec/obidos/AS...590327/sr=2-3-
/ref=sr_2_3/103-8017330-2186264


Thanks. I just ordered one. This book is a couple of years old though.
Has the CBO changed much for 9i?

Jul 19 '05 #5
jag
On Thu, 31 Jul 2003 00:34:56 GMT, "Jim Kennedy"
<kennedy-down_with_spammers@no_spam.comcast.net> wrote:
Hard to know if we don't see the explain plan and tkprof outputs.(and the
sql)
Jim


Of course. I wouldn't want to subject anyone else to that. One is
enough. :)

That's why I was just asking for general hints and book
recommendations. Fortunately using + RULE has bought me enough time to
allow me to get some studying in. I suspect I'll have a lot better
knowledge of the CBO and Oracle internals once I'm done and that's a
great thing.

My sincere thanks to everyone responding.
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SAP BASIS Consultant | last post by:
Hello, I have worked with Oracle and SAP over a number of years. I worked a bit with DB2 and SAP, and I am expecting to do so in the future. I am looking for a good book on tuning (For both OLTP...
5
by: renny | last post by:
Dear Oracle/DB2 DBAs, I'm looking for advice on tuning Oracle 9i and DB2 8.1 for rollbacks. I have a number of developers, who each build and test our client/server database application...
3
by: mleal | last post by:
Does anyone have some more detailed information about how Oracle and MS implement / allow Tuning on Oracle 10g and SQL Server 2005 and the differences between them? Which of them, In a deep...
0
by: Medhatithi | last post by:
Hi, I have been in several ways benefiited from this site. I would like to share some sql tuning techniques(simple, but effective) with you all. SQL Tuning Tips Oracle Tips Session #6 ...
1
by: Vinod Sadanandan | last post by:
A Roadmap To Query Tuning ============================ For each SQL statement, there are different approaches that could be used to retrieve the required data. Optimization is the process of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.