FIX: Running JOIN on Three or More Tables is Slow (163420)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
This article was previously published under Q163420 SYMPTOMS
Running a SQL query that joins three or more tables in Visual FoxPro 5.0 is
very slow. If Visual FoxPro 3.x is available for testing, this same query
performs much faster by comparison. Using the new JOIN syntax with the SQL
Select statement is also slow.
CAUSE
One or more of the tables have only one or only a few records that join
with the other tables.
RESOLUTION
The query speed can usually be increased by using the new SQL Select syntax
in Visual FoxPro 5.0 for JOINS in conjunction with the FORCE keyword.
Using the sample SQL Select statements from step 3 under the Steps to
Reproduce Behavior section below, the addition of the FORCE keyword makes
the queries run much faster:
SELECT * FROM FORCE test1 ;
INNER JOIN test2 ON test2.id = test1.id ;
INNER JOIN test3 ON test3.id = test2.id
SELECT * FROM FORCE test1 ;
INNER JOIN (test2 INNER JOIN test3 ON test3.id = test2.id );
ON test2.id =test1.id
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. This problem has been fixed in
Visual FoxPro 5.0a.
REFERENCES
Microsoft Visual FoxPro "Developer's Guide" version 5.0, pages 214-215
Modification Type: | Major | Last Reviewed: | 10/16/2002 |
---|
Keywords: | kbBug kbusage kbvfp500aFIX KB163420 |
---|
|