[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread jose isaias cabrera
Scott Robison wrote... > Also, it seems a lot of people today are critical of programs that utilize > defined behavior in the context of the standard to which they were > written, > but not to a later standard (such as ANSI C / C89 / C90 vs C99 or C11 or > whatever). It's great to conform to

[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread Simon Slavin
"SQLite is a carefully engineered and thoroughly tested piece of software. Even so, it contains undefined behaviors because, until recently, no good checker for these behaviors existed. If anything is going to save us from UB hell, it?s tools combined

[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread Richard Hipp
On 3/18/16, Igor Tandetnik wrote: > On 3/18/2016 4:40 PM, Keith Medcalf wrote: >> There is no such thing as "undefined behaviour". The machine code does >> exactly what it is told to do > > But SQLite is not written in machine code. It is (largely) written in C. SQLite is written in C, but the

[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread Igor Tandetnik
On 3/18/2016 4:40 PM, Keith Medcalf wrote: > There is no such thing as "undefined behaviour". The machine code does > exactly what it is told to do But SQLite is not written in machine code. It is (largely) written in C. And C language most certainly has the concept of undefined behavior -

[sqlite] In-Memory estimate size

2016-03-18 Thread Michele Pradella
Which is the best way to estimate the size of an In-Memory DB? Now I'm using (PRAGMA page_size)*(PRAGMA page_count) to have an idea of the size in RAM of the db. It's quite ok but obviously it gives a value less than the real (probably because indexes and other stuff are missing from cont) For

[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread Scott Robison
On Fri, Mar 18, 2016 at 4:03 PM, Richard Hipp wrote: > On 3/18/16, Igor Tandetnik wrote: > > On 3/18/2016 4:40 PM, Keith Medcalf wrote: > >> There is no such thing as "undefined behaviour". The machine code does > >> exactly what it is told to do > > > > But SQLite is not written in machine

[sqlite] Wall checkpoint not running

2016-03-18 Thread Domingo Alvarez Duarte
Hello ! I'm applying the strategy bellow on two applications executing in parallel but it doesn't work, I mean both applications update the database but the wall grows unbound. local function setItemsFieldNullOnEmpty(field) { ??? print("setItemsFieldNullOnEmpty", field); ??? local stmt_find

[sqlite] Wall checkpoint not running

2016-03-18 Thread Domingo Alvarez Duarte
Hello ! So why I was having the problem in the scenario described on the original post ? Cheers ! > Fri Mar 18 2016 04:12:41 PM CET from "Richard Hipp" >Subject: Re: [sqlite] Wall checkpoint not running > > On 3/18/16, Domingo Alvarez Duarte wrote: > >>Hello ! >> >> Thanks for

[sqlite] Wall checkpoint not running

2016-03-18 Thread Domingo Alvarez Duarte
Hello ! I have a question about what is considered a reader ? Is a prepared statement considered a reader ? local stmt = dbprepare("select id from atable where onefield=?"); Cheers ! > Fri Mar 18 2016 03:50:30 PM CET from "Richard Hipp" >Subject: Re: [sqlite] Wall checkpoint not

[sqlite] Wall checkpoint not running

2016-03-18 Thread Domingo Alvarez Duarte
Hello ! Thanks for reply ! Yes I read it and realize that I'm suffering "*Checkpoint starvation"*, see my own reply where I tried to solve this but I'm not sure how to synchronize, coordinate several applications to do not make redundant checkpoints. Any idea on how to achieve it ? (no

[sqlite] Wall checkpoint not running

2016-03-18 Thread Domingo Alvarez Duarte
Hello ! Thank you for reply ! PRAGMA wal_autocheckpoint; -> 1000 PRAGMA wal_checkpoint; -> busy 0| log 0| checkpointed 0 //database was properly checkpointed before this Have a look at my own reply that try to solve the problem but do not solve redundant checkpoints. Do you know

[sqlite] [SPAM] Re: ASK matchinfo performance

2016-03-18 Thread David Raymond
For Python, you just have to replace the sqlite3.dll file in your \Python27\DLLs folder. (Or equivalent folder for other versions) You can either copy in the precompiled one, or compile your own dll with different compilation options etc. The only downside to this is that everyone who's running

[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread Marc L. Allen
I had a long response to this, but it occurs to me that you're just being pedantic for fun. Am I wrong? -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Keith Medcalf Sent: Friday, March 18, 2016

[sqlite] Wall checkpoint not running

2016-03-18 Thread Domingo Alvarez Duarte
Hello ! After writing my problem and thinking about it I found that my unique reader probably is the one blocking the checkpoint, so I modified it and now wall file do not grows unbound. But how to coordinate several applications to not been doing redundant checkpoints ? Maybe we need a

[sqlite] Wall checkpoint not running

2016-03-18 Thread Domingo Alvarez Duarte
Hello ! I have a database with more than 12,000,000 rows in one table and around 6GB in size, it's in wall mode and when I run this program the wall file grows unbound, it doesn't seem that the checkpoint is doing any work. I read the documentation and as I understood the automatic

[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread Keith Medcalf
There is no such thing as "undefined behaviour". The machine code does exactly what it is told to do in exactly the manner in which it has been told to do it and obtains exactly the correct answer every time. That the computation is "advanced beyond the realm of understanding of the

[sqlite] Wall checkpoint not running

2016-03-18 Thread Simon Slavin
On 18 Mar 2016, at 2:00pm, Domingo Alvarez Duarte wrote: > I have a database with more than 12,000,000 rows in one table and around 6GB > in size, it's in wall mode and when I run this program the wall file grows > unbound, it doesn't seem that the checkpoint is doing any work. Can you

[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread Scott Hess
Not sure where you're going with this. "Undefined behavior" in this case is obviously referring to things defined by the C standard. Things not defined by the standard can (and do) change over time as compilers advance, and also often differ between compilers from different vendors. -scott On

[sqlite] In-Memory estimate size

2016-03-18 Thread Richard Hipp
On 3/18/16, Michele Pradella wrote: > Which is the best way to estimate the size of an In-Memory DB? > Now I'm using (PRAGMA page_size)*(PRAGMA page_count) to have an idea of > the size in RAM of the db. It's quite ok but obviously it gives a value > less than the real (probably because indexes

[sqlite] Wall checkpoint not running

2016-03-18 Thread Richard Hipp
On 3/18/16, Domingo Alvarez Duarte wrote: > Hello ! > > Thanks for reply ! > > Yes I read it and realize that I'm suffering "*Checkpoint starvation"*, see > my own reply where I tried to solve this but I'm not sure how to > synchronize, > coordinate several applications to do not make redundant

[sqlite] Wall checkpoint not running

2016-03-18 Thread Richard Hipp
On 3/18/16, Domingo Alvarez Duarte wrote: > > I have a database with more than 12,000,000 rows in one table and around 6GB > in size, it's in wall mode and when I run this program the wall file grows > unbound, it doesn't seem that the checkpoint is doing any work. > > I read the documentation