[sqlite] two threads block eachother opening db (WAL)

2018-07-02 Thread Charles Samuels
I have found that when my process has a lot of threads each of which opens a DIFFERENT database, they each block on eachother while opening each database. Here is a little rust program to demonstrate the problem: If you simply remove the line "PRAGMA journal_mode = WAL;", then the program runs

Re: [sqlite] Performing a SELECT on an enormous database...

2014-10-26 Thread Charles Samuels
Richard, On Saturday, October 25, 2014 05:31:35 AM Richard Hipp wrote: > However, when updating a row, SQLite rewrites the entire row. (It has to, > because of the use of variable-width encodings, since a change to any field > effects the location of all subsequent fields.) So if you have a

Re: [sqlite] Retrieve a int or a sqlite_int64

2014-05-13 Thread Charles Samuels
On Tuesday, May 13, 2014 12:02:27 PM gwenn wrote: > Is there any way to differentiate one value persisted with > sqlite3_bind_int from another persisted with sqlite3_bind_int64 ? No, there's no difference > How to know which method between sqlite3_value_int and > sqlite3_value_int64 should be

Re: [sqlite] More LSM leak

2014-05-08 Thread Charles Samuels
On Thursday, May 08, 2014 03:16:57 AM Dan Kennedy wrote: > On 05/08/2014 06:59 AM, Charles Samuels wrote: > > This leak cursor leak can be consistently reproduced by my test program, > > but it doesn't occur every time you create and delete the cursor. > > Hi, > > Th

[sqlite] More LSM leak

2014-05-07 Thread Charles Samuels
This leak cursor leak can be consistently reproduced by my test program, but it doesn't occur every time you create and delete the cursor. The files you'll need are: http://www.derkarl.org/~charles/lsm/smaller.trace.bz2 http://www.derkarl.org/~charles/lsm/runlsm.cpp (The latter of which has

[sqlite] sqlite_master and sessions

2012-08-15 Thread Charles Samuels
Hi, I'm using the Sessions extension, and I'm seeing a problem in which when calling sqlite3session_changeset(), it calls sessionSelectStmt with zTab="sqlite_master", which fails because that table has no primary key. I'm doing sqlite3session_attach(d->sqlSession, 0), so that should include

[sqlite] sqlite sessions: handling rollbacks

2012-06-13 Thread Charles Samuels
I'm using sqlite's sessions module, and I'm noticing that it doesn't appear to handle rollbacks. Specifically, if I'm recording a database, and then I rollback the database, the session module appears to still record the changes made by that rollback. Why does this apparently significant

Re: [sqlite] The "sessions" branch

2012-05-31 Thread Charles Samuels
On Thursday, May 31, 2012 11:53:18 f.h. Richard Hipp wrote: > On Thu, May 31, 2012 at 2:40 PM, Charles Samuels <char...@cariden.com>wrote: > > So, I'd like to ask what's wrong with the session extension that it's > > never been rolled into the main distribution and hasn't bee

[sqlite] The "sessions" branch

2012-05-31 Thread Charles Samuels
Hi, I couldn't help but notice that in the sqlite fossil repository, there's a branch named "sessions" which has this: http://www.sqlite.org/cgi/src/dir?name=ext/session This is a very useful feature for me because it would allow me to rollback a change after it's been committed (if somehow

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-30 Thread Charles Samuels
On Wednesday, May 30, 2012 2:02:39 e.h. Igor Tandetnik wrote: > How about this. You create two views, say V1 and V2, one with the join > and one without. Take user-provided query, replace all occurences of V1 > with V2, and try to prepare the new query. If that succeeds, the new > query is

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-30 Thread Charles Samuels
On Wednesday, May 30, 2012 1:51:54 e.h. Marc L. Allen wrote: > So, the user provides a standard SQL query using your composite view? Or > are they providing some other construct that you convert into a query > using your view? The user speaks SQL. Charles

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-30 Thread Charles Samuels
On Wednesday, May 30, 2012 1:10:17 e.h. Marc L. Allen wrote: > Wouldn't it be easier to construct a couple of different views and then > intelligently decide which view to use based on the user request? If I could determine which tables the user were interested in and then shift the view beneath

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-30 Thread Charles Samuels
On Wednesday, May 30, 2012 12:03:02 e.h. Marc L. Allen wrote: > 1) The left outer join table is joined by a unique column AND > 2) No other data from the joined table is used in the query. > > Is that about right? Almost: add "recursively": I actually have it nested with *another join* with the

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-30 Thread Charles Samuels
On Wednesday, May 30, 2012 11:29:00 f.h. Black, Michael (IS) wrote: > Since you have a one-to-one relationship I'm not sure why you don't just > put the inseam with the Employee, but perhaps you're just giving an > example here. It is an example. > > I would do it this way which is going to run

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-30 Thread Charles Samuels
On Wednesday, May 30, 2012 10:14:22 f.h. Charles Samuels wrote: > sqlite> select Name from Employee join Uniform on > Employee.name=Uniform.employeename; > Joe > Dave > sqlite> explain query plan select Name from Employee join Uniform on > Employee.name=Uniform.employee

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-30 Thread Charles Samuels
On Wednesday, May 30, 2012 10:02:24 f.h. Igor Tandetnik wrote: > On 5/29/2012 8:21 PM, Charles Samuels wrote: > > Suppose you have a query like this: > > > > select Employee.name from Employees left join Uniform on > > > > (EmployeeSize.name=Uniform.emp

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-30 Thread Charles Samuels
On Wednesday, May 30, 2012 9:45:16 f.h. David Bicking wrote: > If Uniform has a given EmployeeName twice, you will get the Employee.Name > twice in this query. Thus it would be a different result than if you did > not join with Uniform. On Wednesday, May 30, 2012 9:57:00 f.h. Petite Abeille

[sqlite] Why can't sqlite disregard unused outer joins?

2012-05-29 Thread Charles Samuels
Suppose you have a query like this: select Employee.name from Employees left join Uniform on (EmployeeSize.name=Uniform.employeeName) This query's result should be identical weather or not we have that join; it's an outer join, not an inner join, afterall. However, explain query plan

Re: [sqlite] Please review this email to sqlite's mailing list

2012-05-16 Thread Charles Samuels
On Wednesday, May 16, 2012 1:28:17 e.h. Simon Slavin wrote: > On Tue, May 15, 2012 at 1:55 PM, Charles Samuels <char...@cariden.com>wrote: > > At some point, we get a checkpoint; at this instant, what is in otherdb > > and what is in sqlite is what we want committed

Re: [sqlite] Please review this email to sqlite's mailing list

2012-05-16 Thread Charles Samuels
On Wednesday, May 16, 2012 11:33:02 f.h. Igor Tandetnik wrote: > Well, SQLite doesn't. Basically, you want SQLite to maintain multiple > not-yet-committed versions of the same record. Well, yes, but it already does; you can rollback a savepoint. If I could rollback a savepoint and then

Re: [sqlite] Please review this email to sqlite's mailing list

2012-05-16 Thread Charles Samuels
On Wednesday, May 16, 2012 10:00:37 f.h. Adam DeVita wrote: > Did you check out > http://www.sqlite.org/inmemorydb.html > > Could you use an in-memory db to act as a db for a save point? Yes, but this is incredibly hard: I have to maintain the schema twice, I can't allow the user to enter their

[sqlite] Please review this email to sqlite's mailing list

2012-05-15 Thread Charles Samuels
I'm using sqlite in addition to another database ("otherdb") storing data in a specific manner. I'm trying to keep atomicity of my disk commits. It can take several minutes for otherdb to commit, and while it commits it can already start accumulating data for a future transaction. Some of the

Re: [sqlite] Compile sqlite3 with g++? Do I need a wrapper?

2011-06-28 Thread Charles Samuels
On Tuesday, June 28, 2011 9:36:22 f.h. Stephan Beal wrote: > There is NOTHING wrong with mixing .c and .cpp files in one C++ project. > Compile the C code with gcc and C++ code with g++, and then link them > together as you would any other objects. Compiling sqlite as C++ is "hopeless", so this

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Charles Samuels
On Wednesday, February 02, 2011 11:06:59 am Drake Wilson wrote: > Quoth Oliver Peters , on 2011-02-02 18:25:04 +: > > I'm on Win XP with sqlite 3.7.5 and trying to get cents from euro but > > sometimes > > Don't do that. ... Most people doing > currency calculations should

Re: [sqlite] Committing to a savepointL

2011-01-17 Thread Charles Samuels
On Thursday, January 13, 2011 7:55:28 pm Pavel Ivanov wrote: > What you really want is for database engine to allow to have two > parallel writing transactions and for it to not lock the whole > database in those transactions but do some fine-grained locking > instead. Well, that would work, but

Re: [sqlite] Committing to a savepoint

2011-01-13 Thread Charles Samuels
On Thursday, January 13, 2011 3:23:55 pm Simon Slavin wrote: > Look at savepoints: > > http://www.sqlite.org/lang_savepoint.html Yes, I have been, and I use them quite a bit. However, they don't appear to meet my needs, which is why I asked my question. Charles

[sqlite] Committing to a savepoint

2011-01-13 Thread Charles Samuels
Hi, I have a program that uses sqlite to do bookkeeping for another set of data. I do a commit on sqlite once I'm certain the other set of data is done. While I'm waiting for the other set of data to process, I might make other changes to my Sqlite database. However, I don't want to commit

[sqlite] Massive performance regression in 3.7.x

2010-09-25 Thread Charles Samuels
Greetings, With the sqlite database here: http://www.derkarl.org/~charles/massive_performance_regression.bz2 There is a massive performance regression between 3.7.1 and 3.7.2, when compared to 3.6.23.1. The following query runs orders of magnitude slower than it did in the previous version:

[sqlite] transactions in one thread

2009-09-28 Thread Charles Samuels
I need to be able to see the committed version of a database while a new transaction is in the works. I would like to open the same database file twice in a single thread, start a transaction on one of the database connections, make a few writes to that database, then on the other database