Sorry for the late reply... I have been monitoring our stats and implemented query number 3 on 1.9.6
As as side note, I noticed that on 1.9.8, it's now using the 3rd query also.
I am happy to report that after 2 weeks of monitoring, it seemed to do the trick. I'm not getting the errrors any longer (knock on wood).
If some of you are using 1.9.6 or earlier, I suggest you implement this fix/edit as it amy solve the same problem you're experiencing.
Thanks again Jordan & Moodle developers!