Re: [sqlite] sqlite3 performace

2008-01-18 Thread Jay Sprenkle
On Jan 17, 2008 3:48 PM, Philip Nick [EMAIL PROTECTED] wrote: Greetings, Currently I am using sqlite3 in a multi-process/multi-threaded server setting. opening a file is very slow. You need to move it out of your loop. I have noticed my program basically reads the whole database every time

Re: [sqlite] sqlite3 performace

2008-01-18 Thread Philip Nick
I tracked down the problem. I was linking an old version of sqlite3 (3.0.8). That was the old version we used. I apparently doesn't cache between calls. My code now performs IO very similar to the CLI. Each subsequent query once the db is open does not require re-reading the whole db. My next

Re: [sqlite] sqlite3 performace

2008-01-18 Thread Ken
Upgrading to 3.5.4 will be bennificial. You should be able to pass the connection around to the various threads with no problems. Just make sure you compile (.configure --enable-threadsafe) and you should be good. No need to add your own mutex as its done internally by the sqlite code.

Re: [sqlite] sqlite3 performace

2008-01-18 Thread John Stanton
Philip Nick wrote: I tracked down the problem. I was linking an old version of sqlite3 (3.0.8). That was the old version we used. I apparently doesn't cache between calls. My code now performs IO very similar to the CLI. Each subsequent query once the db is open does not require re-reading the

Re: [sqlite] sqlite3 performace

2008-01-18 Thread John Stanton
John Stanton wrote: Philip Nick wrote: I tracked down the problem. I was linking an old version of sqlite3 (3.0.8). That was the old version we used. I apparently doesn't cache between calls. My code now performs IO very similar to the CLI. Each subsequent query once the db is open does

Re: [sqlite] sqlite3 performace

2008-01-17 Thread drh
Philip Nick [EMAIL PROTECTED] wrote: Greetings, Currently I am using sqlite3 in a multi-process/multi-threaded server setting. I use a Mutex to ensure only one process/thread can access the database at one time. The current flow of events: Get Mutex Open Database connection Run Query

Re: [sqlite] sqlite3 performace

2008-01-17 Thread Philip Nick
Thanks for replying, I have tried moving the Open/Close outside the mutex no change. As for using our own mutex, we started with early versions of sqlite and had to come up with our own solution. I was planning on looking into using the built in mutex's, but first I need to solve the performance

RE: [sqlite] sqlite3 performace

2008-01-17 Thread James Dennett
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philip Nick Sent: Thursday, January 17, 2008 1:48 PM To: sqlite-users@sqlite.org Subject: [sqlite] sqlite3 performace Greetings, Currently I am using sqlite3 in a multi-process/multi-threaded

Re: [sqlite] sqlite3 performace

2008-01-17 Thread John Stanton
Areyou doing an sqlite3_finalize and checking to see that you actually close the DB? Philip Nick wrote: Thanks for replying, I have tried moving the Open/Close outside the mutex no change. As for using our own mutex, we started with early versions of sqlite and had to come up with our own