hello,

i have a couple of questions about my SQL query. 

1. if i want all rows in table 1 that may or may not have a counterpart
row in table 2, i use LEFT JOIN. this is HORRIBLY slow! why? if i make it
a simple join (i.e., without the words "LEFT JOIN") then it is a little
faster. 

2. secondly, i need to have an OR in my join clause. 

   where 
     (table1.col1 = table2.col1 or table1.col2 = table2.col1) 

 this is for a search procedure. if i remove the OR, it is much faster.
how can i get around this? i need to have the OR because of the search
engine in the website, but i need it to be fast. 

3. based on the OR condition, what kind of indices can i use? 

thanks/erick


mysql, sql, query



__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to