Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

difference between fast and slow queries >> tip

Status
Not open for further replies.

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
 
Tektip: I appreciate your intent, but you might be better served creating FAQ's for these intended pointers.

Also consider that some of what you've been suggesting is already documented in-depth, try reading the FAQ areas, there's even a chance that you might learn something.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top