in reply to
Re^4: For a better efficiency and speed question!
in thread For a better efficiency and speed question!
Nothing wrong really, but you ask for efficiency and speed, and anything counts...
AND ((date + 1 YEAR) < (CURRENT_DATE + 240 DAYS))
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
I'm suggesting this instead:
AND ((date + 125 DAYS) < CURRENT_DATE)
Now for each record you sum 125 to date and compare this with current date. You are creating a new var, not two.
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