FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » SQL optimization join
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
SQL optimization join [message #168451] Wed, 01 May 2013 04:38 Go to next message
Jack Hard is currently offline  Jack Hard
Messages: 7
Registered: December 2012
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
I must to have some SQL queries every day, it generally involves joins I'd like to know which is the most properly way to do a join for example in this tables

A("a",x,y)
B("b",'a',z,w)

where a and b are primary keys,
which is better?

SELECT *
FROM a,b
WHERE a.a=b.a AND a.x<constant

or

SELECT *
FROM (SELECT * FROM a WHERE x < constant) t, b
WHERE t.a=b.a

It means, is better make first the where clause and after make the join or I can do the join and after filter by where
Re: SQL optimization join [message #168534 is a reply to message #168451] Wed, 15 May 2013 10:17 Go to previous message
eclipsewebmaster is currently offline  eclipsewebmaster   
Messages: 46
Registered: November 2009
Location: Ottawa, Ontario, Canada
Karma: 0
Member
add to buddy list
ignore all messages by this user
First method.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: PHP object scope
Next Topic: html entity double escaping
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 17 03:19:35 EST 2017

Total time taken to generate the page: 0.00784 seconds