Home » SQL & PL/SQL » SQL & PL/SQL » Which query is faster? (simple query)
Which query is faster? (simple query) [message #424390] Fri, 02 October 2009 01:07 Go to next message
123soleil
Messages: 35
Registered: July 2006
Member
Hi,

I'd like to know if one query is faster than the other and by how much. Also, is there a good tutorial on query optimization?

query 1
select * from address, client
where client.addr_id = address.id
and client.type_id = 1


query2
select * from address,
(select * from client where type_id = 1) client
where client.addr_id = address.id

Many thanks!
Re: Which query is faster? (simple query) [message #424394 is a reply to message #424390] Fri, 02 October 2009 01:42 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
None is faster, both are same one: Oracle will rewrite the query to get the faster one.

For your question about tutorial, read http://www.orafaq.com/forum/m/382787/102589/?msg_382787

Regards
Michel
Re: Which query is faster? (simple query) [message #424402 is a reply to message #424390] Fri, 02 October 2009 02:47 Go to previous message
123soleil
Messages: 35
Registered: July 2006
Member
many thank!
Previous Topic: Difference between Varchar2/Char and CLOB
Next Topic: Headings for duplicate columns
Goto Forum:
  


Current Time: Sun Dec 11 02:19:26 CST 2016

Total time taken to generate the page: 0.04062 seconds