Dear all,=0A=0A=0AI have a query that takes a rather long time and was wondering if there is =0Aanyway to optimize it.=0ANormally we removing duplicate records by phone number. This query takes about a =0Asecond and =0A=0Ait really slows down the process when we are importing several 1000 records a =0Aday.=0A=0AHere is the query:=0A=0ASELECT count(id) c FROM leads=0AWHERE (phone_home = '(770) 512-8990' =0AOR phone_work = '(770) 512-8990' =0AOR phone_other = '(770) 512-8990' =0AOR phone_mobile = '(770) 512-8990' =0AOR phone_fax = '(770) 512-8990') =0AAND date_entered >DATE_SUB(NOW(),INTERVAL 45 DAY) =0AAND deleted != '1';=0A=0AThis is the describe:=0A=0ADESCRIBE SELECT count( id ) c=0AFROM leads=0AWHERE (=0Aphone_home = '(770) 512-8990'=0AOR phone_work = '(770) 512-8990'=0AOR phone_other = '(770) 512-8990'=0AOR phone_mobile = '(770) 512-8990'=0AOR phone_fax = '(770) 512-8990')=0AAND date_entered > DATE_SUB( NOW( ) , INTERVAL 45 =0ADAY ) =0AAND deleted != '1'=0A=0A=0Aid =0Aselect_type =0Atable =0Atype =0Apossible_keys =0Akey =0Akey_len =0Aref =0Arows =0AExtra =0A=0A1 SIMPLE leads ALL =0Aidx_del_user,phone_home,phone_mobile,phone_work,phone_other,phone_fax,date_entered=0A NULL NULL NULL 636433 Using where =0A=0AAny thoughts?=0A=0AThank you,=0A=0APaul=0A=0A=0A
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=listsearcharchive@lassosoft.com
Mar 15
Michael Dykman Re: Optimize query help.
Mar 15, 2011; 13:22
Michael Dykman
Re: Optimize query help.
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!