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
Close Database connection
Release Mutex

This seems to work well except I have noticed some performance issue when
the database grows beyond a MB.

I have noticed my program basically reads the whole database every time the
query is run. The IO Read bytes increases by 900k for every query we run. We
also chew a good chunch of the cpu  I have tried keeping the database
connection open and open/closing for every query. But there was no change.

if I launch the CLI and run the query it runs instantly and monitoring the
IO read bytes is see only ~20 bytes of read to execute the query, when my
code is using over 900k for every call. I have been looking into the CLI
source to see what is done differently, but was hoping someone on here might
have some insight.

Thanks
Phil


--

Reply via email to