Re: [sqlite] How to detect "database disk image malformed" in advance?

2013-11-08 Thread Mario M. Westphal
> If you have a contrary example, please send me a > copy of the database file via private email. I take it from your reply that the integrity_check indeed should reveal problems in the database file which cause the "disk image malformed" return code so my logic is OK as it is. Unfortunately,

Re: [sqlite] How to detect "database disk image malformed" in advance?

2013-11-08 Thread Simon Slavin
On 8 Nov 2013, at 3:06pm, Mario M. Westphal wrote: > The first phase in my analysis checks the data in the database for logical > problems, business logic issues etc. > After this phase has been completed, my diagnosis function runs: > > 1. PRAGMA integrity_check(100) > 2.

Re: [sqlite] How to detect "database disk image malformed" in advance?

2013-11-08 Thread Richard Hipp
On Fri, Nov 8, 2013 at 10:06 AM, Mario M. Westphal wrote: > > 1. PRAGMA integrity_check(100) > 2. VACUUM > 3. ANALYZE > > My idea was that these routines should reveal problems reading from or > writing to the database file. > > Today I had a case where my diagnosis considered a

Re: [sqlite] Row Level Locking as in InnoDB

2013-11-08 Thread Howard Chu
Raheel Gupta wrote: Hi, You use BDB SQL or BDB KV ? I built BDB 6.0.20 with --enable-sql_compat It made a libsqlite3.so in the .libs folder which I linked with my QT C++ Application. You must try it with SQLightning too, https://gitorious.org/mdb/ sqlightning I tried to build it, but it

[sqlite] How to detect "database disk image malformed" in advance?

2013-11-08 Thread Mario M. Westphal
I have implemented diagnostic routines which allow my users to check the database for problems. If something bad happens to a database (which may be not the fault of SQLite at all, e.g. a network problem or disk problem) I want to detect this as early as possible in order to inform the user. This

Re: [sqlite] Where does SQLite write out files?

2013-11-08 Thread Ben
Don't try to redirect the SQLite temporary files. In the long run, you'll be in for more maintenance. Instead work within the sandbox limitations. Are you using SQLite as a file format or looking to edit arbitrary SQLite files? If you're making a custom file format, put the SQLite database

[sqlite] Recursive vs nested triggers

2013-11-08 Thread Carlson, Jay
All, I saw in the documentation that recursive triggers are supported and enabled by default as of 3.7.0, and as there was no mention of nested triggers I assumed (wrongly, it would seem) that in sqlite3 the concept of recursive triggers included nested triggers as well. In the following

[sqlite] Why does SQLite refuse to use available indexes when adding a JOIN?

2013-11-08 Thread Ofer Sadgat
Hello, I have been trying to solve this problem for a while and have had no luck, so this is the first time I am trying asking for help here. I apologize if this is not the correct place to ask such questions and would appreciate if you would forward this to the appropriate location or let me

Re: [sqlite] Row Level Locking as in InnoDB

2013-11-08 Thread Raheel Gupta
> > This is the BDB SQL doc I found. > > > http://docs.oracle.com/cd/E17076_02/html/bdb-sql/dbfeatures.html#bulkloading > > If you insert record in bulk, you can use PRAGMA TXN_BULK for optimization. > I tested TXN_BULK, still pretty slow. Nearly 2.4 times. Also the space wastage is pretty high. I

Re: [sqlite] Row Level Locking as in InnoDB

2013-11-08 Thread Raheel Gupta
Hi, >> You use BDB SQL or BDB KV ? I built BDB 6.0.20 with --enable-sql_compat It made a libsqlite3.so in the .libs folder which I linked with my QT C++ Application. >> You must try it with SQLightning too, https://gitorious.org/mdb/ sqlightning I tried to build it, but it says lmdb.h missing.

Re: [sqlite] sqlite db getting corrupt on power outage scenarios

2013-11-08 Thread Simon Slavin
On 8 Nov 2013, at 6:41am, Mayank Kumar (mayankum) wrote: > [MK] I am using a flash drive running on linux kernel 2.6.27.10(SMP). The > corruption is sometimes seen on sqlite db on the flash drive and sometimes > seen on sqlite db in nvram. Network file system is not

Re: [sqlite] Row Level Locking as in InnoDB

2013-11-08 Thread Aris Setyawan
This is the BDB SQL doc I found. http://docs.oracle.com/cd/E17076_02/html/bdb-sql/dbfeatures.html#bulkloading If you insert record in bulk, you can use PRAGMA TXN_BULK for optimization. On 11/8/13, Aris Setyawan wrote: > You use BDB SQL or BDB KV ? > > You must try it

Re: [sqlite] Row Level Locking as in InnoDB

2013-11-08 Thread Aris Setyawan
You use BDB SQL or BDB KV ? You must try it with SQLightning too, https://gitorious.org/mdb/sqlightning On 11/8/13, Aris Setyawan wrote: >> For a single threaded application BDB is very bad after I tested. >> It takes nearly 2.5 times the amount of time and CPU to do a

Re: [sqlite] Row Level Locking as in InnoDB

2013-11-08 Thread Aris Setyawan
> For a single threaded application BDB is very bad after I tested. > It takes nearly 2.5 times the amount of time and CPU to do a transaction of > 40MB Data. E.g. If SQLIte did the 40MB data transaction (1 rows of 4 K) > in 1 second, BDB was taking 2.5 seconds and more CPU as well. I did this

Re: [sqlite] Row Level Locking as in InnoDB

2013-11-08 Thread Raheel Gupta
>> No. It's not even feature-frozen yet, as far as we know. And whenever it is, it's incredibly unlikely to have row level locking. Please add row-level locking if possible. On Fri, Nov 8, 2013 at 12:03 AM, Simon Slavin wrote: > > On 7 Nov 2013, at 6:31pm, Raheel Gupta

Re: [sqlite] Row Level Locking as in InnoDB

2013-11-08 Thread Raheel Gupta
>> If you have many core of processors [and big RAM], then I recommend BDB Sql over Sqlite. Because you can have many processes or threads to write to a database concurrently. For a single threaded application BDB is very bad after I tested. It takes nearly 2.5 times the amount of time and CPU to