> On Apr 22, 2019, at 11:39 AM, Lee, Jason <[email protected]> wrote:
> 
> Hi. Are there any gotchas when opening multiple independent databases from 
> within one process using the C API?

Do you mean different database files, or multiple connections to the same file?

> I am opening one database per thread in my code, and noticed that 
> sqlite3_open_v2 and sqlite3_close slow down as the number of threads 
> increase, indicating there might be some resource contention somewhere, even 
> though the databases should be independent of each other.

How many databases/threads? With huge numbers I’d expect slowdowns, since 
you’ll be bottlenecking on I/O.

But otherwise there shouldn’t be any gotchas. I would troubleshoot this by 
profiling the running code to see where the time is being spent. Even without 
knowledge of the SQLite internals, looking at the call stacks of the hot-spots 
can help identify what the problem is.

—Jens
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to