Home » SQL & PL/SQL » SQL & PL/SQL » Performance Issue
Performance Issue [message #10277] Mon, 12 January 2004 21:31 Go to next message
Developer
Messages: 19
Registered: January 2004
Junior Member
Hi!

Is there any kind of difference between these two quiries

1)
select e.empno
from emp e, dept d
where e.deptno = d.deptno

2)
select e.empno
from emp e, dept d
where d.deptno = e.deptno

regards
Re: Performance Issue [message #10279 is a reply to message #10277] Mon, 12 January 2004 22:49 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
No.

MHE
Re: Performance Issue [message #10281 is a reply to message #10279] Mon, 12 January 2004 23:03 Go to previous messageGo to next message
resy
Messages: 86
Registered: December 2003
Member
Yes. Ofcourse there is no difference in output.
But it is always a good practice that use the table name which has more records in left side of where condition.
Re: Performance Issue [message #10284 is a reply to message #10281] Tue, 13 January 2004 01:43 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Wasn't the question. In fact, it used to be good practice to put the driving table last in the table list, and in the left parts of the select.

But Oracle's optimizer has gone beyond that need.

MHE
Oops [message #10295 is a reply to message #10284] Tue, 13 January 2004 20:36 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Typed too fast: should (of course) be:
...it used to be good practice to put the driving table last in the table list, and in the left parts of the where clause equasions.

MHE
Re: Performance Issue [message #10339 is a reply to message #10277] Thu, 15 January 2004 06:01 Go to previous message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
See here --> Joins
and
Join Order

-Thiru

[Updated on: Fri, 18 February 2005 23:32]

Report message to a moderator

Previous Topic: retrieving data from a form
Next Topic: what does watermark in oracle mean
Goto Forum:
  


Current Time: Thu Apr 25 09:45:27 CDT 2024