GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   SQL question (https://gfy.com/showthread.php?t=589474)

alex79 03-22-2006 03:03 AM

SQL question
 
What is the difference between

Code:

Select * from tablea a join tableb b on a.id=b.id
        where id=100

and

Code:

Select * from tablea a join tableb b on a.id=b.id and a.id=100
Is the second sintax faster? in first case the script will realise the join after all rows from tablea and after the join is complete will filter after the id=100 and is second case the join will be realised only after the row where id=100? (if yes then second case i think is much faster)

any opinions?

woj 03-22-2006 04:38 AM

Your best bet is to just make up some tables, and test it real quick...

pstation 03-22-2006 04:52 AM

They're essentially the same, if you're using MySQL you can prepend the query with "EXPLAIN" to view more information about the query.


All times are GMT -7. The time now is 05:20 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123