Hi, 
 
Thanks for the feedback on my earlier problem. I have come up with a
query:
 
SELECT *, count(contact_id) AS theCount
FROM eventlog
LEFT JOIN contacts ON contacts._id = eventlog.contact_id
WHERE TYPE = 'CLICK' AND link_id IN (1,2)
GROUP BY contact_id
HAVING theCount = 2

Thing is it takes forever to run, I haven't seen it complete yet i just
have to keep killing the process. I have read up on optimisation and
have added some index's to the eventlog table: contact_id and
link_id (contact_id on the contacts table is the PK anyways so thats
fine).
 
Any ideas on how to speed this up. (In the process list it says the
state is "Copying to tmp table" for ages).
 
 
Thanks
 
Carl Chambers
  

Reply via email to