Optimization of the sets / find

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Feb 17 22:15:24 CST 2005


On 2/17/05 9:01 PM, "Olivier" <vidal_olivier at yahoo.fr> wrote:

> Hi Ruslan and list,
> 
> e.g
> 
> I have a form of address in the screen which the user has to fill.
> To help him, there is a system of auto-completion where in every typed
> letter, the app proposes a choice of possible words.
> There are three options for the auto-completion:
> 
> 1- auto-completion by the beginning of sentence (indexed and
> findStartWith)
> 2- auto-completion by the beginning of word (indexbyWord and
> findStartWith)
> 3- auto-completion by LETTERS (findcontains)
> 
> Naturally, with the third option, it is slower.
> In every typed letter, Valentina has to make a search " findContains ".
> In every typed letter, the search is completely redone.
> I thought I could use in every search the previous set to accelerate
> the search but there is no acceleration. It would have been very
> useful!
> 
> E.g.
> Number of records: 80 000
> Edifield.text = "P"
> 
> - > Set1=fd.findContains ("P") // for example, 3 000 found records
> 
> The user continues to type:
> Editfield.text = "PA"
> 
> - > Set2=fd.findContains ("PA", Set1)
> This method is NOT faster than set2=fd.findcontains ("PA")... why ?

This method will be faster ONLY if you do not have index on a field.
Then you really reduce the number of records for iteration.


But when exists index this Set1 do not help. We still need scan each
distinct value in the index. And this is constants time.

Hmm, of course if Set1 contains e.g. One record but index has 100,000
distinct values then really it is better not use index. So really exists
some condition. Please put this into mantis, and copy this my text there.



-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




More information about the Valentina-beta mailing list