note
pvaldes
<p>Nothing wrong really, but you ask for efficiency and speed, and anything counts...</p>
You use:
<c>AND ((date + 1 YEAR) < (CURRENT_DATE + 240 DAYS))</c>
<p>Let's see the algoritm. For each record you sum 365 to date and remember this number, then you sum 240 to current date and save this to a new var somewhere in the memory, then you compare both numbers</p>
I'm suggesting this instead:
<c>AND ((date + 125 DAYS) < CURRENT_DATE)</c>
<p>Now for each record you sum 125 to date and compare this with current date. You are creating a new var, not two.</p>
<p>Thus you need less memory and is also a little less demanding operation for the CPU. Nothing to care for when you have a few sums but in this context could suppose one advantage</p>
929567
929601