"CARTER-HITCHIN, David, FM" <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Really hope someone out there can help me with this.
> 
> I've written a C++ cache class which extracts ad-hoc data from a Sybase
> database and inserts it into an in-memory SQLite database.  This is working
> fine but is very slow during the insert data phase.  To give some
> quantitative idea of what I mean by slow:
> 
> a) If I run the extract with the Sybase isql command line utility and dump
> that to a file it takes 2/3 minutes (~800,000 rows, 100MB of data).
> b) If I run my cache class with the insert into SQLite commented out it
> takes 2/3 minutes.
> c) Uncommenting the insert statement, the extract/insert takes ~45 mins!
> 
> Something is misconfigured as it takes ~20 times as long to insert into an
> in-memory db, as it does to select from Sybase and store to a file. 
> 
> Any ideas, however slight, will be much appreciated!
> 

Idea 1:  You are trashing.  What OS are you running and how much memory
         is installed in the machine.

Idea 2:  Might you be doing an insert trigger that is taking a long time?

Idea 3:  You have about 100 different indices on the table that all have
         to be updated with each insert.

FWIW, SQLite normally does about 50000 inserts per second, not the 300
you are seeing.  So something is clearly wrong.
--
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to