Hi all,
I have done a lot of experimentation s using several
"or" predicates within an sql select statements on mysql.
My only conclusion so far is that whatever syntax or order
I use it is always slower than doing seperate
sql statements (one for each or) and programaticaly
adding them to a vector.
The performance of any "or" statement is really really bad.
does anyone out there manages to get resonable results out of
an or in an sql statements? If you do can you point me to what
rules you use to get the best out of mysql.
here is a typical example of the or I have used
select
customers.accou nt_nb, customers.name, addresses.telep hone_1,
addresses.telep hone_2, addresses.telep hone_3, addresses.post_ code
from customers, addresses
where (
(addresses.tele phone_1 = '+44 (0) 122 464 264 7') or
(addresses.tele phone_2 = '+44 (0) 122 464 264 7') or
(addresses.tele phone_3 = '+44 (0) 122 464 264 7');
Thanks for your help
Regards,
Fred
I have done a lot of experimentation s using several
"or" predicates within an sql select statements on mysql.
My only conclusion so far is that whatever syntax or order
I use it is always slower than doing seperate
sql statements (one for each or) and programaticaly
adding them to a vector.
The performance of any "or" statement is really really bad.
does anyone out there manages to get resonable results out of
an or in an sql statements? If you do can you point me to what
rules you use to get the best out of mysql.
here is a typical example of the or I have used
select
customers.accou nt_nb, customers.name, addresses.telep hone_1,
addresses.telep hone_2, addresses.telep hone_3, addresses.post_ code
from customers, addresses
where (
(addresses.tele phone_1 = '+44 (0) 122 464 264 7') or
(addresses.tele phone_2 = '+44 (0) 122 464 264 7') or
(addresses.tele phone_3 = '+44 (0) 122 464 264 7');
Thanks for your help
Regards,
Fred
Comment