Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHERE Clause and Performance

Status
Not open for further replies.

Benouche

Programmer
Aug 6, 2002
48
FR
Hello,

a little question on the Where Clause.

Is there performance difference between the 2 following:
WHERE test1 AND test2 (solution 1)
WHERE test2 AND test1 (solution 2)

As test2 require many operations while test1 few, is (solution 1) best or simply equal ?
 
This will be very database specific, in Oracle the cost based optimiser wil analyze the where clause in one direction while the rule based optimzer analyzes it in the other direction. I tried to remain child-like, all I acheived was childish.
 
I would recommend you run an Explain Plan so that Oracle can tell you the execution path.

If one of the predicates in the Where statement should use an index according to your knowledge, and the Plan shows it does not, well, go figure ... AA 8~)
 
I don't think it makes a difference.
In Oracle, with RBO (Ruled based Optimizer), the order of the tables in the "from" clause makes a difference.

Regards
 
I don't think it makes a difference.
In Oracle, with RBO (Rule based Optimizer), the order of the tables in the "from" clause makes a difference.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top