Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Performance problem using local view in a grid (VFP 5.0)
Message
From
03/06/1998 05:21:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/06/1998 15:47:59
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00103893
Message ID:
00104293
Views:
28
>Thank you, sir!
>
>Your suggestion made a very dramatic difference in timing. I had already set an index on play_list_no, but clearly was not using it properly. This is a lesson well-learned, one that will help me to make improvements in other sections of code.
>
>Again, thank you very much, Mr. Basoz, for your valuable time!
Ernie,
Since you're going changes in other sections, a few suggestions here :
-Avoid do while...enddo as much as possible. Scan...endscan, for..endfor are faster (scan ..endscan do an implicit skip, supports "for", "while" and if there is an index benefit it - BTW you can use for and while in conjunction).
-In expressions choose from one that have an index already. ie: You have an index on lastname+firstname and want to search for a lastname in a scan..endscan. Instead of (..for lastname=cLastName) use (.. for lastname+firstname=cLastName) to benefit index automatically (set exact is off by deafult and this would work when exact is off).
-Keep a dummy index tag for deleted (index on deleted() tag dummy).
-Whereever possible use SQL counterparts of commands. ie: instead of (append blank, replace f1 with cF1, f2 with dF2 ...) use (insert into myTable (f1,f2...) values (cF1, dF2...)). This works not only faster, but sometimes prevent extra code errors as well.
List is rather long and detailed in "Optimizing ..." section in online documentation (and help).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform