Hi Bill,
>If I understand you right, the TRUE time that my query takes is the first time I run it.
Yes.
>Switching to a different application (while VFP is waiting at the command window) switches VFP to background buffer and throws out the foreground information.
VFP is reducing its buffer from the foreground size to the background size. Since the background buffer is usually smaller, VFP has to throw out everything that doesn't fit in.
>I just test that idea, by equalizing both foreground and background buffer, and sure enough it ran the query at the same speed each time.
Now that's great, at least for me. *bg*
>So the speed of my query is a function of the design?
Basically, yes. There might be alternatives, depending on the application, but they probably require a different design. For example, you could use a trigger on table2 to upate a counter in table1. If you then had an index on that counter field, you could run an optimized query that would be faster.
Christof
--
Christof