Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering Question
Message
 
 
À
04/10/2001 08:11:33
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00564048
Message ID:
00564107
Vues:
18
>hi,
>
>Showing data with a grid and set filters to view the wanted records is a very common thing.. i think most people should have tried it..
>
>I also have a form to do such thing, but for one of the filter settings, the grid would become VERY slow, each click on the grid takes 3-5 seconds to get focus, but it works just fine with other filters..
>
>would anyone please have a look and see if the following filter would make the grid act so strangely slow?
>
>select MyTable
>
>filter_expr=allt(thisform.myTextbox.value)  && see what the user want to see
>filter_desc=iif(UsingFirstLang(), "name1", "name2")  && check different field when using different language setting
>set filter to at(filter_expr, &filter_desc)>0
>
>thisform.grdIT03Itemlist.refresh()
>
>
>any idea? Please help~
>Jimi

Try this instead:
lcFilterStr="set filter to like('*"+filter_expr+"*'"+filter_desc+")"
&lcFilterStr

Unfortunately, LIKE is not Rushmore optimizable function, so it still would be slow.

It's better to use something like NAME1="Some Val", if you set SET EXACT OFF and use partial comparision. In this case your name should start from "Some Val" and you should have index on Name in your table.

Any kind of inclusion comparision is not optimzable, so you never would get good perfomance. I also found, that Grid and Filters don't like each other, but unfortunately, I have to work with filters and grids.

Watch out for no records condition. BTW, how can we tell, that all records are filtered out?
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform