Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To improve the speed in VFP 6.0 exe
Message
 
To
22/11/2000 20:00:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00443927
Message ID:
00445304
Views:
20
Harry,
Sorry for the delay answering, I wasn't in the office Thursday or part of Friday.

From your description of your slow report I think you need to optimize your SELECT statements. First read about Sys(3054), Rushmore Optimization Level in the Help system and try it out with a few simple SELECT statements.

Second, Rushmore works when you have indexes that exactly match the WHERE clauses in your SELECT statements. Assuming that when they pick a date range your users are looking at only a small portion of the 30,000 records you will need to have an index on that date. It must be in exactly the same format as your WHERE clause: If you use

... Between(MyDateField, Date()-7, Date() )

then your index will need to be on the date field. If you use dtos(StartDate) and dtos(EndDate) you'll need to index on dtos(MyDateField).

Third, you'll need indexes for EACH where clause if at all possible. If you are SELECTing on date and on location (for example) be sure you also have an index on the location field.

Finally, look at the other steps in the process and try to optimize them as well.

A simple way of testing for which steps take the longest is to add a line that prints to a text file or the screen after each step. Show the step just taken and the time to the second or even 100ths of seconds. This is easy to do if you move your code temporarily to a PRG. You can print this information on the screen with the "?" command.

When you find a slow step see if it can be speeded up with better optimization. If not post another message on this thread and someone will take a look at it.

HTH
Barbara

>Dear Barbara,
> Thanks again for your kindness. Perhaps, I need to outline a bit on my program:
> 1. The VFP exe is generated from the project manager; forms by
> Form designer
> 2. Everything start with DO form in a prg file
> 3. There is a menu system in the main form which calls other forms
> 4. There are also some command buttons in the main form to call those forms
> 5. Related databases/tables are added to the data-environment of each forms
>
> My program is actually a POS system used in photo shops
> The slowing points occur during retrieval/manipulation of data.
>One of the slowest module is in the "Sales Report". Details:
> 1. A total of about 10 tables are involved.
> 2. Firstly the user enters the date period for the report
> 3. The actual process occurs in the Loss Focus Event in
> one textbox after the user has entered the ending date
> 4. Calculation of sales amount involving SELECT,SUM etc
> 5. Organization of data into temporary files: APPEND...FOR, SUM etc
> 6. Further calculation on profit by checking cost price etc.:
> using REPLACE, SEEK etc commands
> 7. Rearranging data into another file
> 8. Re-display data into a grid
> It takes about 4 mins for a record size of 30,000!!
> (My computer is P-90 48Mb RAM and plenty of Disk space;
> VFP 6.0;Window 98)
>
> I look forward to receiving your further suggestions.
>
>Thanks very much.
>
>Harry
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform