Re: [sqlite] Very slow when query max(col) on empty set?

2014-05-18 Thread Woody Wu
On Friday, 9 May 2014, RSmith <rsm...@rsweb.co.za> wrote: > > On 2014/05/08 18:16, Woody Wu wrote: > >> On 2014年5月8日 GMT+08:00PM11:59:33, RSmith <rsm...@rsweb.co.za> wrote: >> >>> On 2014/05/08 14:13, Woody Wu wrote: >>> >>>> Do

Re: [sqlite] Very slow when query max(col) on empty set?

2014-05-08 Thread Woody Wu
On 2014年5月8日 GMT+08:00PM11:59:33, RSmith <rsm...@rsweb.co.za> wrote: > >On 2014/05/08 14:13, Woody Wu wrote: >> >> Do you mean that my index for this case is already the best choice? >> >> And, as a general question, for a query in the form of >>sele

Re: [sqlite] Very slow when query max(col) on empty set?

2014-05-08 Thread Woody Wu
On 2014年5月8日 GMT+08:00PM11:59:33, RSmith <rsm...@rsweb.co.za> wrote: > >On 2014/05/08 14:13, Woody Wu wrote: >> >> Do you mean that my index for this case is already the best choice? >> >> And, as a general question, for a query in the form of >>sele

Re: [sqlite] Very slow when query max(col) on empty set?

2014-05-08 Thread Woody Wu
On 2014年5月8日 GMT+08:00PM9:14:52, Clemens Ladisch <clem...@ladisch.de> wrote: >Woody Wu wrote: >> On 2014年5月8日 GMT+08:00AM1:51:43, Clemens Ladisch <clem...@ladisch.de> >wrote: >>> Simon Slavin wrote: >>>> You can let SQLite make a better estimate by

Re: [sqlite] Very slow when query max(col) on empty set?

2014-05-08 Thread Woody Wu
On 2014年5月8日 GMT+08:00AM1:51:43, Clemens Ladisch <clem...@ladisch.de> wrote: >Simon Slavin wrote: >> On 7 May 2014, at 1:29pm, Woody Wu <narkewo...@gmail.com> wrote: >>> The 'explain query plan' gives same result for the first and the >second query: >>> &g

Re: [sqlite] Very slow when query max(col) on empty set?

2014-05-07 Thread Woody Wu
On 2014年5月7日 GMT+08:00AM3:16:35, Clemens Ladisch <clem...@ladisch.de> wrote: >Woody Wu wrote: >> The following query statement executed very slow, it took 15 secs on >my ARM device, >> >> 1. select max(time) from mytable where time < and id1 = k1 >and

[sqlite] Very slow when query max(col) on empty set?

2014-05-06 Thread Woody Wu
than 1 second on the same system. Also, I tried to replace the very large time value to a small enough one, 3. select max(time) from mytable where time < 0 and id1=k1 and id2=n This query also run very fast. Could anyone explain this to me? Thanks in advance.

Re: [sqlite] Mailing List

2014-05-04 Thread Woody Wu
qlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -Woody Wu ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Virtual Memory Size used looks too large

2014-02-19 Thread Woody Wu
On 20 February 2014 04:35, Clemens Ladisch <clem...@ladisch.de> wrote: > Woody Wu wrote: >> On 19 February 2014 23:09, Clemens Ladisch <clem...@ladisch.de> wrote: >>> Woody Wu wrote: >>>> sqlite is using mmap to map the database file? >> >>

Re: [sqlite] Virtual Memory Size used looks too large

2014-02-19 Thread Woody Wu
On 19 February 2014 23:09, Clemens Ladisch <clem...@ladisch.de> wrote: > Woody Wu wrote: >> I found my sqlite application presents a huge VSZ usage, 100+M in an >> ARM system, which has only 128M physical memory. Does this because >> sqlite is using mm

[sqlite] Virtual Memory Size used looks too large

2014-02-19 Thread Woody Wu
Hi, List I found my sqlite application presents a huge VSZ usage, 100+M in an ARM system, which has only 128M physical memory. Does this because sqlite is using mmap to map the database file? If this is the reason, how can I reduce the VSZ used? I checked my application with Valgrind, I think

[sqlite] How to disable the use of malloc()?

2014-02-19 Thread Woody Wu
Hi, I want to omits the Sqlite's internal invocation of malloc(3). What I tried were following, 1. Provide sqlite compile time options "-DSQLITE_ZERO_MALLOC -DSQLITE_ENABLE_MEMSYS5" 2. In the startup code of my application, call: sqlite3_config(SQLITE_CONFIG_HEAP, my_static_array, ...) Do you

Re: [sqlite] Do I really need rollback after sqlite3_step returns BUSY?

2014-01-07 Thread Woody Wu
was trying to update still locked by another process. This is normal, right? On 7 January 2014 19:32, Simon Slavin <slav...@bigfraud.org> wrote: > > On 7 Jan 2014, at 10:13am, Woody Wu <narkewo...@gmail.com> wrote: > > > Thanks for the clear guide. _busy_timeout is eas

Re: [sqlite] Do I really need rollback after sqlite3_step returns BUSY?

2014-01-07 Thread Woody Wu
Thanks for the clear guide. _busy_timeout is easier to use. By the way, i want confirm that if i am not in an explicit transaction, i can simply redo the _step() invoking, right? On Tuesday, 7 January 2014, Simon Slavin wrote: > > On 7 Jan 2014, at 8:50am, Woody Wu <narkewo...@

[sqlite] Do I really need rollback after sqlite3_step returns BUSY?

2014-01-07 Thread Woody Wu
Hi, The manual says that it should to rollback after sqlite3_step() returns SQLITE_BUSY as long as the current statment is in a transaction. Is this true? Why I cannot just sleep for a while and redo the sqlite3_step()? Thanks in advance. -- Life is the only flaw in an otherwise perfect

Re: [sqlite] Error 11 after doing a lot of simple insert/update operations!

2014-01-02 Thread Woody Wu
Kaminskiy wrote: > Woody Wu wrote: > > Hi, Simon > > > > I upload the source code onto my dropbox: > > https://www.dropbox.com/s/9shhshi0wn3e717/downloadfile.c Please have a > > look at it. > > > > The same test program run without a problem on my pc Li

Re: [sqlite] Error 11 after doing a lot of simple insert/update operations!

2014-01-01 Thread Woody Wu
Does anyone have a clue? BTW, happy new year :) On Tuesday, 31 December 2013, Woody Wu wrote: > Hi, Simon > > I upload the source code onto my dropbox: > https://www.dropbox.com/s/9shhshi0wn3e717/downloadfile.c Please have a > look at it. > > The same test program run wi

Re: [sqlite] Error 11 after doing a lot of simple insert/update operations!

2013-12-31 Thread Woody Wu
eabi compiler. With the same complier and the toolchain, I have been buit a whole target ARM system including kernel, 1000 open source applications, even including a tiny X window. On Tuesday, 31 December 2013, Simon Slavin wrote: > > On 31 Dec 2013, at 8:41am, Woody Wu <narkewo...@

[sqlite] Error 11 after doing a lot of simple insert/update operations!

2013-12-31 Thread Woody Wu
Hi, I found sqlite (3.8.2 as well as 3.7.17) cannot stand reliably with some simple insert/update operations on a single table with primary key. I found this problem on ARM platform with varities of filesystems including UBIFS, Yafss on NAND, and Ext4 on SDCARD. Attached is the test program

Re: [sqlite] Is that same between rebinding every parameter and

2013-12-30 Thread Woody Wu
Thanks, Igor. On Monday, 30 December 2013, Igor Tandetnik wrote: > On 12/30/2013 9:14 AM, narkewo...@gmail.com wrote: > >> If I don't call sqlite3_clear_binding but rebind every parameter with >> sqlite3_bind_type before every sqite3_step after sqlite3_reset, will it >> be any different? >> > >

Re: [sqlite] What number(2) means?

2013-07-10 Thread Woody Wu
. It's just a database created many years ago, probabaly sqlite supported that then. Thanks for your explaination. > On Wed, Jul 10, 2013 at 10:06 AM, Woody Wu <narkewo...@gmail.com> wrote: > > On Wed, Jul 10, 2013 at 09:53:41AM +0200, Paolo Bolzoni wrote: > >> See here: >

Re: [sqlite] What number(2) means?

2013-07-10 Thread Woody Wu
On Wed, Jul 10, 2013 at 09:53:41AM +0200, Paolo Bolzoni wrote: > See here: > http://www.sqlite.org/datatype3.html > > I think it just means Integer. And its > size depends on the magnitude of the > number stored. > I've read the doc, it's not so easy to understand. Did you mean, in number(N),

[sqlite] What number(2) means?

2013-07-10 Thread Woody Wu
I have an old dabase, some integer columns were defined as type of number(2). What does this mean in sqlite3? What's the data ragne it can represent, and how much bytes it will consume when stored? Thanks in advance. -- I can't go back to yesterday - because I was a different person then

[sqlite] Questions about exclusive transation

2013-06-25 Thread Woody Wu
Hi, I have serveral questions about exclusive transaction. (version 3.7.x) 1. When a exclusive transation started and not yet commit, I found if I open another connection to the same database and try to access it (using sqlite3_step), I got the error code SQLITE_MISUSE. It sounds a little

Re: [sqlite] Database Corrupted!

2013-05-28 Thread Woody Wu
system was built by our external vendor, I don't know their process. Can I check if it's correctly done? Erasing Yaffs2 means something like 'mke2fs' on a ext* file system? Thanks. > > > On Mon, May 27, 2013 at 11:44 PM, Woody Wu <narkewo...@gmail.com> wrote: > > >

Re: [sqlite] Database Corrupted!

2013-05-27 Thread Woody Wu
On Tue, May 28, 2013 at 03:08:55AM +0100, Simon Slavin wrote: > > On 28 May 2013, at 2:37am, Woody Wu <narkewo...@gmail.com> wrote: > > > How do you guys think about this: if NAND has an > > IO problem, Yaffs2 should recover it or forward the error to > > a

Re: [sqlite] Database Corrupted!

2013-05-27 Thread Woody Wu
On Mon, May 27, 2013 at 04:31:25PM +0100, Simon Slavin wrote: > > On 27 May 2013, at 4:22pm, Woody Wu <narkewo...@gmail.com> wrote: > > > If Yaffs2 is the cause, how can I write an effective test to exposure it? > > Do you have an opportunity to format the same

Re: [sqlite] Database Corrupted!

2013-05-27 Thread Woody Wu
nderstand what's the right responsibilities of a fs or device driver. > > On Mon, May 27, 2013 at 10:22 AM, Woody Wu <narkewo...@gmail.com> wrote: > > > Richard, > > > > If Yaffs2 is the cause, how can I write an effective test to exposure it? > > I strace

Re: [sqlite] Database Corrupted!

2013-05-27 Thread Woody Wu
On Mon, May 27, 2013 at 11:33:08AM -0400, Richard Hipp wrote: > On Mon, May 27, 2013 at 11:22 AM, Woody Wu <narkewo...@gmail.com> wrote: > > > Richard, > > > > If Yaffs2 is the cause, how can I write an effective test to exposure it? > > > > Do you re

Re: [sqlite] Database Corrupted!

2013-05-27 Thread Woody Wu
On Mon, May 27, 2013 at 04:31:25PM +0100, Simon Slavin wrote: > > On 27 May 2013, at 4:22pm, Woody Wu <narkewo...@gmail.com> wrote: > > > If Yaffs2 is the cause, how can I write an effective test to exposure it? > > Do you have an opportunity to format the same dr

Re: [sqlite] Database Corrupted!

2013-05-27 Thread Woody Wu
vin <slav...@bigfraud.org> > wrote: > > > > > On 27 May 2013, at 1:25pm, Clemens Ladisch <clem...@ladisch.de> wrote: > > > > > Woody Wu wrote: > > >> I have a testing code, attached in this email, if continuously run it > > for > > >>

Re: [sqlite] Database Corrupted!

2013-05-27 Thread Woody Wu
On Mon, May 27, 2013 at 11:08:57AM +0800, Woody Wu wrote: > Hi, List > > Probably this is another case of database corrupted. I read the > documents about this topic and think I did not make same mistakes > described in that 'how to corrupt ...' documentation. > > I have a t

[sqlite] Database Corrupted!

2013-05-27 Thread Woody Wu
Hi, List Probably this is another case of database corrupted. I read the documents about this topic and think I did not make same mistakes described in that 'how to corrupt ...' documentation. I have a testing code, attached in this email, if continuously run it for 20 - 40 hours, the sqlite