Fast reading?

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Sat Apr 10 02:12:16 CDT 2010


On 4/9/10 6:04 PM, "Thomas Flemming" <tf at ttqv.com> wrote:

> Hi,
> 
> to write large amount of data into the database there is:
> 
> "INSERT INTO [mytable] (f1, f2, f3, ... ) VALUES ( :1, :2, :3, ...)"
> 
> which is very fast.
> 
> Is there also something similar to READ all fields of a record very fast into
> an array of objects?
> 
> I'm still doing
> 
> cursor.Position = i
> f1 = cursor.fields("f1").value
> f2 = cursor.fields("f2").value
> f3 = cursor.fields("f3").value
> ...
> 
> 
> which is quiet slow...

What difference in time you have?


Hint 1:
    use in loop by records
    curs.NextRecord()  instead of  cursor.position.


Should be little faster.


But I think main problem why it is slower:

* insert just append usually new record to the end of file,
 and again append and again, so we write into the same place of HDD.


* but in your SELECT, most probably you have ORDER BY,
And effectively you start ask records from very different places of HDD.

This is why it takes time. Hardware issue.




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