At 15:03 -0700 4/4/06, Sripathi Raj wrote:
Hi,
 I have a few questions regarding SQLite. I'm using it on Windows and
connecting to it from Perl.

And I will answer some of them.

1. How do I find out if the current version of DBD::SQLite uses SQLite
3.0or greater?

DBD::SQLite versions >= 1.0 embed SQLite versions >= 3.x.

DBD::SQLite versions < 1.0 and all DBD::SQLite2 embed SQLite versions <= 2.x.

2. How do I allow dirty reads? I understand that the whole file is locked
for writing but I believe I can do reads using a deferred transaction. How
do I do this from the Perl DBI?

I'm not sure that what you want is possible.  But why would you want to?

3. The performance for inserts is really bad. Around 40k entries takes a few
hours. What might I be doing wrong? I do a commit after all the inserts.

A few things to help with speed:

1. Use DBI's prepared statements; eg, 1 prepare() and many execute().

2. Don't commit for each row inserted but batch them so, say, you commit once per 1000 rows.

Thanks,

Raj

-- Darren Duncan

Reply via email to