The information in this article applies to:
SUMMARY
Visual FoxPro 5.0 and later have a new clause, the FORCE clause, in the
SELECT - SQL command. You can use the FORCE clause to override the default
query optimization that Visual FoxPro performs.
MORE INFORMATION
When a SQL statement is processed, the SQL optimizer determines the most
efficient way to join the tables. There are times when you have a better
understanding of the data structures than FoxPro. The FORCE clause, tells
Visual FoxPro that the SELECT statement is optimized and that it does not
need to be further changed.
In the first SELECT statement, the orders and orditems tables are joined
and the result is joined to the customer table. In the second statement,
the customer table is joined with the orders table first. The result is
then joined with the orditems table.
In order to make the decision to Force a join condition, you can use the SYS(3054) function to determine the extent to which the query is optimized by Rushmore technology. For example, you can issue the following command before the SELECT statement to determine the internal optimization plan for the query:
SYS(3054) returns information, such as the index tag used to optimize the
join as well as the optimization level for each table, whether it be
'full,' 'partial,' or 'none.'
Sometimes, you can determine the best optimization level by trial and error. Try running the SQL statement with and without the FORCE clause to see if there is a significant change in performance. Make sure to clear the environment between SELECT statements so that caching does not effect the outcome of successive queries. Additional query words:
Keywords : kbDatabase kbSQL kbVFp500 kbVFp600 |
Last Reviewed: August 23, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |