[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: SQL performance tuning..
- Subject: Re: SQL performance tuning..
- From: "Wanko, Christopher G, CFCTR" <apollo@ATT.COM>
- Date: Mon, 17 Jul 2000 10:50:04 -0400
> For purposes of efficiency, is there a "rule of thumb" as to
> what sequence to
> specify the table names in the "FROM" clause?
Your database will probably reorder things for efficiency automatically.
> In the WHERE clause, what about the sequence of the keys for
> each table,
> especially the keys that are
> used to join the 2 tables?
I would join the most restrictive keys first (ones least likely to find
rows) in order to minimize rows being processed for the next WHERE clause,
but again, your database may optimize this by reordering automatically.
> to optimize SQL code and have never
> been given any training in how to optimize code.
There should be an Oracle FAQ available (I have the Sybase one) that details
some basic info on profiling SQL queries. The Sybase equivalent is running
a "showplan" with "no execute"; essentially you run a query against the
database without returning rows, but the database engine details how it
would execute the query (what indices it would use, how it would process the
query and in what order it would execute statements).
-Chris