FIX: Decrease in performance occurs with repeated execution of SELECT-SQL in Visual FoxPro for Windows 5.0 and in Visual FoxPro for Windows 6.0 (191172)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q191172 SYMPTOMS
There is a slow degradation of Visual FoxPro's performance with repeated
execution of SELECT-SQL statements. The results returned by SYS(1016) and
the time required to process SELECT-SQL statements gradually increase with
repeated execution of SELECT-SQL statements.
CAUSE
This is caused by repeated execution of a SELECT-SQL statement containing
WHERE and OR clauses, as in the following example:
SELECT * ;
FROM <TABLE NAME> ;
WHERE .T. ;
OR .T. ;
INTO CURSOR TEST
RESOLUTION
Here are three ways to workaround this problem:
- Use the HAVING clause in the SELECT-SQL statement rather than the WHERE clause. For example:
SELECT DISTINCT * ;
FROM <table name> ;
HAVING <condition 1> ;
OR <condition 2> ;
OR <condition 3> ;
ORDER BY <order> ;
INTO CURSOR <destination>
- Use the INLIST() function in the SELECT-SQL statement, in place of the OR. For example:
SELECT DISTINCT * ;
FROM <table name> ;
WHERE INLIST(eExpression,<condition 1>, ;
<condition 2>, ;
<condition 3>, ;
ORDER BY <order> ;
INTO CURSOR <destination>;
- Use a UNION for each OR condition. For example:
SELECT DISTINCT * ;
FROM <table name> ;
WHERE <condition 1> ;
UNION SELECT DISTINCT * ;
FROM <table name> ;
WHERE <condition 2> ;
UNION SELECT DISTINCT * ;
FROM <table name> ;
WHERE <condition 3> ;
INTO CURSOR <destination>
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base: 194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
Modification Type: | Major | Last Reviewed: | 3/10/2005 |
---|
Keywords: | kbBug kbDatabase kbfix kbSQLProg kbVS600sp3fix KB191172 |
---|
|