Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Improving sluggish SQL
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00306158
Message ID:
00320499
Views:
19
Hi Nadya,

Check out the first topic at this article from MSDN Library.

Good luck,

Ricardo



"

Retrieving Only the Data You Need

In most applications that use remote data, forms and reports don't need to access all the data from a table at once. Therefore, you can speed performance by creating remote views that fetch or update only the fields and records you want, which minimizes the amount of data that needs to be transmitted across the network.

To create queries that minimize the overhead of data retrieval from remote sources, follow these suggestions:

- Specify only the fields you need. Don’t use the statement SELECT * FROM customers unless you need all the fields from the table.
- Include a WHERE clause to limit the number of records downloaded. The more specific your WHERE clause, the fewer records are transmitted to your computer, and the faster the query will finish.
- If you cannot predict at design time what values to use in a WHERE clause, you can use parameters in the clause. When the query is executed, Visual FoxPro uses the value of a parameter variable or prompts the user for the search value. For example, this query allows the application or user to fill in the region at run time:
SELECT cust_id, company, contact, address ;
FROM customers ;
WHERE region = ?pcRegion

- Set the NoDataOnLoad property of the corresponding Data Environment Cursor object. This technique is commonly used with parameterized views in which the data for the parameter comes from the value of a control on a form."
Previous
Reply
Map
View

Click here to load this message in the networking platform