Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LOCATE goes out to lunch when working in buffer
Message
From
01/02/2000 23:55:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
LOCATE goes out to lunch when working in buffer
Miscellaneous
Thread ID:
00325976
Message ID:
00325976
Views:
52
OK, here's the sitch. A parent table OWNERS has two child PERSON records. I allow the user to delete the second PERSON record in a child form. Both tables have optimistic table buffering. Things work pretty well if I just delete the record and save. The save routine wraps a transaction around the table updates. The save after the delete takes less than a second to complete.

The refreshed display is a little funky, though, so I reason that I should move back to the non-deleted PERSON record after deleting and before saving:

LOCATE FOR PERSON.iOWNERS == OWNERS.iOWNERS and PERSON.nOrder == 1

This instruction takes 30 SECONDS to execute!

Note that there are 171,637 records in the PERSON table and there is an index on PERSON.iOWNERS. There is no index on PERSON.nOrder.

Testing from the command box I issue these instructions:

GO TOP
LOCATE FOR PERSON.tEffective = [value near the bottom]

There is no index on tEffective. This LOCATE takes about 3 seconds.

Testing again in the command box with an indexed field:

LOCATE FOR PERSON.iOWNERS == [value near the bottom]

requires about 30 milliseconds.


Summary:
30 seconds with buffered records and an indexed field
3 seconds with unbuffered records and no index
30 milliseconds with unbuffered records and an indexed field

I will also try to recreate the buffered situation from a small program run from the command box. But I thought I would ask if anyone has seen this behavior.

Peter Robinson
Peter Robinson ** Rodes Design ** Virginia
Next
Reply
Map
View

Click here to load this message in the networking platform