Performance reading field().value
Ruslan Zasukhin
sunshine at public.kherson.ua
Sat Apr 11 13:02:02 CDT 2009
On 4/11/09 7:24 PM, "Thomas Flemming" <tf at ttqv.com> wrote:
Hi Thomas,
> 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
--
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