Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question.

Asked: January 29, 2005 - 8:59 am UTC

Last updated: May 17, 2005 - 9:11 am UTC

Version: 9.1.2

Viewed 1000+ times

You Asked

Hi Tom,

Could you please suggest any good books which exclusively deals with SQL and PL/SQL Tuning?

I already have your two books. I am looking for any good books which completely deals with SQL, PL/SQL tuning for our Library.

Thank you
Vaishnavi


and Tom said...

See the links I like tab above for any books I recommend (mastering oracle plsql for example).

Books on "tuning sql" are not "worth anything"

You need to know sql, know what is available. From there, it is purely "applied knowledge" (see my chapter in Effective SQL in my book "Effective Oracle by Design" to see my thoughts on that)

Anything that can be written down about a series of steps to do to "tune" SQL is already done in the software. We call it the optimizer, the sql access advisor, and so on. If there is a rule that says "try this for better sql", the database is probably already trying it out.


The database will never be able to take:

for x in (select * from t)
loop
insert into another_t values ( x.c1, ... );
end loop;

and turn it into the incredibly fast, performant and correct:

insert into another_t select * from t;


That is tuning -- taking your procedural slow by slow process (row by row) and making it a bulk operation.


Taking a procedural implementation that runs for hours and turning it into a couple of minutes by applying your knownledge of analytics -- now that is tuning SQL.

Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

A reader, January 30, 2005 - 8:32 pm UTC

Hi Tom,
When your new book hitting the market? waiting eagrly....

Tom Kyte
January 30, 2005 - 8:38 pm UTC

end of 2005

dave, January 30, 2005 - 8:52 pm UTC

what happened to May 2005 :-)

Tom Kyte
January 30, 2005 - 9:59 pm UTC

don't think I ever said that - it was always q3 (calendar year) 2005...

Right, May was never mentioned...

Vladimir Andreev, January 31, 2005 - 5:17 am UTC

Just for the record:

Here's the first reference I could find to the famous 9-month cycle:
</code> http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:23060676216774#23096635304317 <code>

and noting that

flado@l440>select add_months(to_date('September 02, 2004','Month dd, yyyy'),9)
2 from dual;

ADD_MONTHS(TO_DATE(
-------------------
2005-06-02 00:00:00

we see that it was close to - but never actually - May :-)

But never mind, take as much time as you need to create another gem :-)
I'm sure we'll all survive somehow.

Cheers,
Flado

Tom Kyte
January 31, 2005 - 8:20 am UTC

you were assuming that the day after I finish writing it would be printed (that never happens) and that the schedule that had not yet been finished, started shortly thereafter :)

it isn't printed for weeks/months after "completion"
it wasn't started in september

:)

SQL Tuning

A reader, May 17, 2005 - 6:31 am UTC

Hi Tom

How about the book SQL Tuning - Dan Tow??


More to Explore

Performance

Get all the information about database performance in the Database Performance guide.