tektipdjango
IS-IT--Management
- Jan 28, 2004
- 188
In another post I put this information that may be usefull for all f us :
--------------
it's a good pratice for queries to put the fields alone and the operations on the other side (left).
so I modifed
{youth_goal.dt_set} + 365 < CurrentDate
to
{youth_goal.dt_set} < CurrentDate - 365
Here it's not important but in selection formulas it will be the difference for the SQL to run on the server a lot quicker if there's an index on the field
--------------------
The server will calculate currentdate once then substract 365 and make the index search
otherwise there is a great chance that it performs a full scan of all the records not using the index and furthermore make the add operation for each record
--------------
it's a good pratice for queries to put the fields alone and the operations on the other side (left).
so I modifed
{youth_goal.dt_set} + 365 < CurrentDate
to
{youth_goal.dt_set} < CurrentDate - 365
Here it's not important but in selection formulas it will be the difference for the SQL to run on the server a lot quicker if there's an index on the field
--------------------
The server will calculate currentdate once then substract 365 and make the index search
otherwise there is a great chance that it performs a full scan of all the records not using the index and furthermore make the add operation for each record