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

Home » General » PHP discussions » SQL optimization join
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
SQL optimization join [message #168451] Wed, 01 May 2013 08:38 Go to previous message
Jack Hard is currently offline  Jack Hard
Messages: 7
Registered: December 2012
Karma:
Junior Member
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: Sat Jun 08 13:52:44 GMT 2024

Total time taken to generate the page: 0.04767 seconds