Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Filter problem
Message
De
08/04/2004 18:32:41
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00893282
Message ID:
00893433
Vues:
23
Hi Gerard

>I've used this technique extensively in 2.6, but have noticed in VFP7/8, that it can be extremely sssssslow if used on a form, particulalry acoss a network. By sssssslow I mean, having to wait 3 minutes on a Goto Top command for a file which ha a filter (with an index). Prior to VFP7/8, it took seconds.

Actually, it depends on the filter condition and the number of records no matter the version. GO TOP is slower than LOCATE with a filter.
CREATE TABLE junk FREE (id i)

FOR id = 1 TO 100000
  INSERT INTO junk FROM memvar
ENDFOR

INDEX ON id TAG id

SET FILTER TO ID = 100000
m.a=SECONDS()
GO TOP
?SECONDS()-m.a

m.a=SECONDS()
LOCATE
?SECONDS()-m.a
With VFP, when you use a grid on a form with a filter, that's when it can get really slow. The only reason I can think of is that the navigation code in the grid is doing things like using GO TOP instead of LOCATE, and who knows what else.

>
>I dont know why this is an nobody has been able to give me satifactory answers..... but just a word of caution
>
>I've ended up replacing my Set Filters to Seelcting out into a cursor.. solved the problem but meant a lot of recoding
>
>Regards,
>
>Gerard
>
>
>
>
>
>
>>Am working with vfp7.1 and Win XP.
>>Want to build a "filter by" form to enable the user to filter a table (part of a DBC) in a number of ways. All of them are fields in the table except one.
>>That is a "Grouping" table that contains all the record ID's for each group. The records can be part of more than one grouping, so there is no field in the actual table containing the group ID.
>> The groupings (names & descriptions) themselves can also be added to, edited, and deleted by the user.
>>
>>The question is:
>>How can I filter the table using the regular "set filter to" expression, but also include records that are included in a particulat grouping (that also match the other filter requirements)?
>>
>>All help appreciated.
>>Bill Wright
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform