select rectype,jobid,jobrecid,template,assignedto,entereddt,enteredby,ref1,processed,processeddt,
processbydt,title,description,connectlanhandle,finished,updateddt,ref2,cancelled,
requireaccept,acceptrejectstate,acceptrejectbydt,alert1dt,alert2dt,alert3dt,despatchallowed,
flag,ref3,projectid,duration,skillset,postcode,prefschedulefrom,prefscheduleto,customdata1,
customdata2,customdata3,hasnotes,displayjobtype,createdby,createddt,colour
from jobs
where updateddt >= '1982-02-05 17:25:38'
or (processed = 'N' and
cancelled = 'N')
order by jobid, jobrecid
This query returns ~80000 results. SQLyog (a MySQL gui) can return the results in a visible grid in ~600ms. My Delphi program, which connects using ODBC (latest MyODBC drivers), takes ~6000ms just to do the query, without even starting to look at the results.
Any ideas on what I can do to make my program faster?