Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Slow multi-user response
Message
 
 
À
14/07/1997 14:12:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00039866
Message ID:
00039880
Vues:
36
>User A adds a new record to a shared table
>
>User B, on a different machine, (or in our test case in another copy of Visual FoxPro running on the same machine) is watching the same table looking for a record with specific content. Fortunately we have an appropriate index. Unfortunately, it is taking from 2 to 5 seconds for user B to find the new record from the time that user A does his replace. What's going on?
>
>User B's code looks something like this
>
> use Food shared in 0
> set order to Vegetable
> do while .t.
> if seek("Turnip")
> ? "We found it at ", seconds()
> exit
> endif
> enddo
>
>User A tried to speed things up by puting a FLUSH command after the REPLACE, but it didn't help.
>
>Things did speed up though to almost instantaneous response when user B changed his code to:
>
> use Food shared in 0
> set order 0 && We won't bother with the index
>
> do while .t.
> go top
> do while !(Food.Vegetable == "Turnip") and !eof()
> skip
> enddo
>
> if Food.Vegetable == "Turnip"
> ? "We found it at ", seconds()
> exit
> endif
> enddo
>
>
>This brute force method that could end up doing hundreds (or thousands) of skips beats the seek approach hands down. Its as if the table update is seen immediately by both processes, but the index update comes 2 to 5 seconds later. Sure, this is a complicated index, ... but 2 to 5 seconds?
>
>Bob

How many index tags do you have for this table? If you have a lot of tags, insert and updates will be make it even slower, as well probably the complexity of the index expressions.

John
It's "my" world. You're just living in it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform