Re: Optimize query help.

2011-03-15 Thread Michael Dykman
The OR conditions require a full table scan everytime this is called. You didn't say how many rows you had, nor if there were indexes on your various phone_xxx fields. If you do, you should get some value by approaching it as a UNION select count(id)from ( select id from leads where phone_work

Optimize query help.

2011-03-15 Thread Paul Nowosielski
Dear all, I have a query that takes a rather long time and was wondering if there is anyway to optimize it. Normally we removing duplicate records by phone number. This query takes about a second and it really slows down the process when we are importing several 1000 records a day. Here is

Optimize query help

2004-10-13 Thread Chris Blackwell
Hi, We log all sessions on our webserver to a table, and then periodically run a batch process to analyze the visitors ip addresses to determine the city/region/country of origin. we use MySQL 4.1.1-alpha-standard-log on Redhat AS, installed from the mysql RPM. The query below takes about 1 seco