Performance reading field().value
Thomas Flemming
tf at ttqv.com
Sat Apr 11 13:30:24 CDT 2009
Hi Ruslan,
thanks for your quick answer, even on a Saturday evening. :-) !
>> 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?
>
> I have not checked sources
> Just ideas from head.
>
> Field.Value -- this is work with VARIANT.
>
> Try to use type-specific way.
> You know types of fields, let it be Ulong.
>
> So
>
> For i = 1 to mCursor.count
> a = mTbl.ULongField(1).value
> b = mTbl.ULongField(2).value
> c = mTbl.ULongField(3).value
> mCursor.NextRecord()
> Next
>
>
I cant find these ULongField classes.
Where are they suppose to be?
I need Strings, Longs and Floats.
Im using v4net.
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