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 
Return to the default flat view Create a new topic Submit Reply
SQL optimization join [message #168451] Wed, 01 May 2013 04:38 Go to previous message
Jack Hard is currently offline  Jack Hard
Messages: 7
Registered: December 2012
Karma:
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
[Message index]
 
Read Message
Read Message
Previous Topic: PHP object scope
Next Topic: html entity double escaping
Goto Forum:
  

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

Current Time: Tue Dec 12 07:31:12 EST 2017

Total time taken to generate the page: 0.00717 seconds