Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Statement Speed
Message
From
23/03/2004 00:32:44
 
 
To
22/03/2004 18:35:19
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00888689
Message ID:
00888742
Views:
10
>My table is aprox 38,000 records. If I browse the table it takes a fraction of a second to view. If I create a local view with out any filters it takes several seconds to view. I was just wandering how to keep the speed up. I only need to filter out a small percentage of records at any one time.

You're being fooled by the power of the browse window.

What you see is not all of the records. The browse window only brings back enough to present the results to the user. If you scroll down fast enough, you will encounter a fetch back to the server, and some lag time.

One of my cardinal rules for client-server apps is to only fetch the records you need, and NEVER - NOT EVER - let the user access the entire data set. You must force them to narrow down the number of records that they are interested in.

Sometimes this takes some creative thought. For example, I often have to visually scan tables for particular patterns of data, and correct those (I seem to get stuck doing a lot of data imports). It is much, much faster to construct a view that does the search for me, than look for these manually (not to mention being more accurate).

My point is that you need to think about what you let the user have access to Indexes are not always the answer, and can in fact cost you (in update performance). Make them do some kind of select first, and results will come back must faster. This is true in VFP as well as SQL, as Rushmore doesn't kick in until you have some type of WHERE clause (or other selective operation) specified.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Reply
Map
View

Click here to load this message in the networking platform