Jay Blanchard wrote:

$qin .= "AND (cdr.dialedno LIKE '800%' ";
$qin .= "OR cdr.dialedno LIKE '866%' ";
$qin .= "OR cdr.dialedno LIKE '877%' ";
$qin .= "OR cdr.dialedno LIKE '888%') ";

OK, I am getting closer to the answer. It seems that the inefficiency is
born in the OR statements. Anyone have any experience with "cleaning up"
something like this?



It seems you're dealing with area code logic. If you can re-schema your tables, consider:


  SELECT ...
LEFT JOIN phoneno on cdr.dialednoid = phoneno.id
   WHERE ...
     AND phoneno.areacode in (866,877,888)
     AND ...

Get the idea?

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to