The query below takes ~2 seconds, which seems really long for such a straightforward join on 2 tables with only ~3000 or so rows.
I strongly suspect the problem is with this line:
but I'm not sure why. Or, perhaps the join condition is screwing things up?
SELECT DISTINCT
, idnum
, DATEDIFF( DATE_ADD(atable.adate, INTERVAL 10 DAY), btable.bdate) as `DIFF`
FROM atable
LEFT JOIN btable
ON atable.idnum = btable.idnum
;
My issue is similar to this, but not the same. Thanks in advance to the great SO community for looking this over.