Geographical indexing

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Apr 19 14:51:51 CDT 2009


On 4/19/09 9:44 PM, "Thomas Flemming" <tf at ttqv.com> wrote:

> I do in every loop:
> 
> dim s as string = "select data_recid,cat from vmapobjects " & _
>                                "where not ((ext_north < :1) Or " & _
>                                           "(ext_south > :2) or " & _
>                                           "(ext_east  < :3) or " & _
>                                           "(ext_west  > :4)) and " & _
>                                "cat<=:5 and " & _
>                                "ext_size>:6;"

This is the same string, right?
Then why not extract it from loop?

> Dim bindings() As Object = {.SouthInt, .NorthInt, .WestInt, .EastInt, _
>                               max_cat, min_ext_size}
> mCurObjects = mDatabase.SqlSelect(s, EVCursorLocation.kClientSide, _
>                                       EVLockType.kReadOnly, _
>                                       EVCursorDirection.kForwardOnly, _
>                                       bindings)

If you have LOCAL db you can try kNoLocks,
Can be faster.


> But maybe I know now what you mean.

> Maybe I should do the mDatabase.SqlSelect(s) only once and then in every loop
> only change the bindings?
> But how?

No, you do it right.

Only string s  can be extracted.
May be creation of Array also..


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list