Re: [sqlite] Shared Cache vs. Serialized

2018-12-30 Thread Keith Medcalf
>Another interesting distinction between shared and private cache mode >I found while experimenting. Ordinarily if connection A is in the >middle of fetching result rows from a SELECT (i.e., sqlite3_step was called, >but not sqlite3_reset), and connection B tries to do a CREATE/UPDATE/DELETE, >B

Re: [sqlite] Shared Cache vs. Serialized

2018-12-30 Thread Jesse Rittner
Jens Alfke-2 wrote > But since the connections are sharing a cache, they still end up seeing > uncommitted writes. I believe this is managed by the read_uncommitted pragma . Another interesting distinction between shared and private

Re: [sqlite] Shared Cache vs. Serialized

2018-12-30 Thread Jens Alfke
> On Dec 30, 2018, at 7:52 AM, Jesse Rittner wrote: > > It > seems to me that there are two ways we can have multiple threads all > accessing a database via a "single" connection. Actually there is at least one more way: Create a global connection pool. When a thread needs to access the

Re: [sqlite] Shared Cache vs. Serialized

2018-12-30 Thread Jens Alfke
> On Dec 30, 2018, at 7:52 AM, Jesse Rittner wrote: > > One, establish a single > serialized private cache connection up front, and give it to all the > threads. Two, have each thread independently establish a multi-thread shared > cache connection. What are the trade-offs between these two

Re: [sqlite] Shared Cache vs. Serialized

2018-12-30 Thread Keith Medcalf
The "normal" connection mode would be to have a separate connection for each thread, with no shared cache. Each connection is opened with the FULLMUTEX (serialized) flags. This is the default. Each connection is fully isolated from every other connection. Assuming that each "thread" has

[sqlite] Shared Cache vs. Serialized

2018-12-30 Thread Jesse Rittner
I've been reading about the shared cache feature and I have a question. It seems to me that there are two ways we can have multiple threads all accessing a database via a "single" connection. One, establish a single serialized private cache connection up front, and give it to all the threads. Two,

Re: [sqlite] Bug in 3.25.2 (RECURSIVE CTE + window function)

2018-12-30 Thread Nicolas Roy-Renaud
I've been dealing with occasional segfaults on one of my applications when running a similar query, except even on SQLite 3.26, the safeguard wouldn't trigger. Running the SQL query specified in the bug report description from the tracker (https://www.sqlite.org/src/tktview?name=e8275b415a)