Performance reading field().value

Thomas Flemming tf at ttqv.com
Sat Apr 11 11:24:22 CDT 2009


Hi,

I'm new to Valentina and currently busy to find out, if I can use it for a 
geographical project which contains some mio objects.

I set up my first database with 500.000 records.
Then I like to query some records (I'm using VB.NET):

Dim mCursor As IVCursor
mCursor = mDB.SqlSelect("select * from myobjects where a>8 and b>3 and c>6")

this gives me for example hundred records in 0.05sec, very fast :-)

Then I like to get the records.
So I loop through the cursor:

Dim mTbl As IVTable = mDB.Table("myobjects ")

For i = 1 to mCursor.count
    a = mTbl.Field(1).value
    b = mTbl.Field(2).value
    c = mTbl.Field(3).value
    mCursor.NextRecord()	
Next

And here is the problem, because this takes some seconds for only 100 records 
in the cursor.
It seems to be the access to a specific Field, which is so slow. Just looping 
through the cursor:

For i = 1 to mCursor.count
    mCursor.NextRecord()	
Next

is still very fast.

Where am I wrong? How can I access the values of a record fast?

Best regards,
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