Geographical indexing

Thomas Flemming tf at ttqv.com
Sun Apr 19 13:44:17 CDT 2009


Hi Ruslan,


>>> Well, I remember that not all queries are and can be cached
>>> But your kind of SELECT should be.
>> But what should be cached? Where should the speed-improvement come from?
> 
> Cached should be general SELECTs, INSERT, UPDATEs,
> Which do not produce TMP tables
> 
> Ivan can better answer this.
> 
> Aha, may be this is why UNION is not cached for you.
> 
> Speed should be better because we skip in such way PARSER overhead.
> 
> 
>> I mean, I never have the same select again.
>> The parameters for the Where-statement are always different.
> 
> If you write like I have show  f > :1
> 
> Then query is the same, Byte to byte.
> 
> Different values go as binded array to SqlSelect()
> 
> May be you not correctly do it?
> Please show code if query with bindings
> 


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;"


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

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?

Tom






> 

-- 
/****************************************
**   Dipl.-Ing. Thomas Flemming
**   Software Development
**
**   Touratech AG
**   Auf dem Zimmermann 7-9
**   D-78078 Niedereschach
**
**   mail  tf at ttqv.com
**   fon   +49 (0) 7728 9279-206
**   fax   +49 (0) 7728 9279-29
**
**   http://www.ttqv.com
**   http://www.touratech.de
**
**   ... und immer dem Pfeil nach!
***************************************/


More information about the Valentina mailing list