[sqlite] The value of nFetchOut and zPath after wal-file calls sqlite3OsOpen()

2017-12-29 Thread advancenOO
I want to analyze the executive process of wal-file with the source code 3.16.2 . And I added: unixFile *pFd = (unixFile *)pRet->pWalFd; if(pFd->nFetchOut != 0){ printf("hi\n"); } to sqlite3WalOpen() after sqlite3OsOpen() is called: rc = sqlite3OsOpen(pVfs, zWalName,

Re: [sqlite] Does sqlite have official development testing tool?

2017-12-19 Thread advancenOO
Thanks for all your suggestions. Is it correct to add my compile-options(such as -DSQLITE_DEFAULT_MMAP_SIZE=0x7fff) just after CFLAGS in Makefile? As I found some weird bugs if I do so. For example, sometimes wal2.test can pass but sometimes it reports "cannot open savepoint - SQL statements

[sqlite] Notification mechanism when truncate a mapped file

2017-12-18 Thread advancenOO
I am trying to make some change to the source code of sqlite as I want to map a file using unixMapfile(). But I guess there will be a SIGBUS crash when one process truncate the file and do not notify other processes who want to access the file later. So I am wondering if there is any appropriate

Re: [sqlite] Does sqlite have official development testing tool?

2017-12-14 Thread advancenOO
Hello Richard, I hope to run some tests by myself and I think TCL tests in your link are what I want. There are so many .tcl and .test in Sqlite source tree. Could someone share what commands I need to run to start all TCL tests? Thanks. -- Sent from: http://sqlite.1065341.n5.nabble.com/

[sqlite] the timing to truncate WAL file to journal_size_limit

2017-12-14 Thread advancenOO
I noticed that, “The journal_size_limit pragma may be used to limit the size of WAL files left in the file-system after transactions or checkpoints. Each time a WAL file resets, SQLite compares the size of the WAL file left in the file-system to the size limit.” But I think only when the first

[sqlite] Does sqlite have official development testing tool?

2017-12-13 Thread advancenOO
I am interested in the source code of sqlite and I want to make some change to it. I wondering if sqlite has official development testing to do a full functional check or evaluate performance lose of my code? I have found sqlspeedtest1,8 and sqlthreadtest3,4. Is there any other testing I should

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
OK, I know it is not safe when use mmap in Android 7 fuse. And do you mean the bug is in fuse kernel framework as you mentioned Android FUSE filesystem driver? Which corresponding to Linux 3.10? By the way, do you have any possible repro steps especially in Android Sqlite? -- Sent from:

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
Yeah. Thanks for your suggestion about -DSQLITE_ENABLE_BATCH_ATOMIC_WRITE. But the version of my sqlite is 3.16.2, so I guess I may use it at a later time int the future. -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___ sqlite-users mailing list

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
Thanks for the notification about the bugs in MacOS. So the most important reason for disable SQLITE_MMAP_READWRITE is the bugs in OS, not the stray pointer in upper applications. Is it right? -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
I am a developer of system, not application. So I have nothing to do with the SQL or indices even though I know these may cut orders of magnitude from execution times. And that is why I use speedtest1.c of Sqlite to evaluate the performance of my system. -- Sent from:

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
Um, stray pointer or array overrun in upper applications will be treated as BUG in my system. And I believe all these bugs could be fixed before using sqlite. So can I safely enable SQLITE_MMAP_READWRITE directly if I can ignore the possibility of the BUG? But I notice that Sqlite may not call

[sqlite] Enabling MMAP in Android

2017-12-11 Thread advancenOO
I find MMAP is able to be used for db files(getPageMMap()) but is not enabled by default. I wonder if it is recommended to use MMAP in Android? As I think MMAP is one way to improve the speed performance(I use speedtest1.c to evaluate). At the same time, Mmap() is only used for reading by

[sqlite] A walIndexAppend() crash after calling "PRAGMA journal_mode"

2017-11-19 Thread advancenOO
I tracked down a occasional system crash problem of calling "PRAGMA journal_mode" and found that walIndexRecover()->walIndexAppend() is finally called before the crash according to my callstack. In sqlite3.c, walIndexAppend() can be called after walIndexRecover() only when nSize, the size of

Re: [sqlite] Does wal-file support MMAP?

2017-11-10 Thread advancenOO
Purely for speed :) I hope to improve the performance inside sqlite in order to optimize the performance of the upper applications. As there are so many different scenes in APPs. -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___ sqlite-users

Re: [sqlite] Does wal-file support MMAP?

2017-11-09 Thread advancenOO
In multi-thread scenario, I guess that threads may not use MMAP correctly after one thread truncates wal-file. And that is the reason MMAP can not be used together with WAL mode. So, I am wondering if I can simply make the size of Wal-file a fixed size to support MMAP for wal-file. -- Sent

[sqlite] Does wal-file support MMAP?

2017-11-08 Thread advancenOO
I am trying to understand how SQLITE_DEFAULT_MMAP_SIZE works and I think db files can use MMAP by using this compilation option, as Sqlite3PagerGet() mapped to getPageMMap(). And I know "/the current VFS implementations use a mmapped file for the wal-index/" But is there a way that wal-files

[sqlite] Performance issue for version 3.9.2 compared with 3.16.2

2017-10-17 Thread advancenOO
In order to profile sqlite 3.9.2 and sqlite 3.16.2, I run speedtest1.c on my mobile phone. It is weird to find that 3.9.2 is better than 3.16.2, especially in the following case: “270, 1 DELETEs, numeric BETWEEN, indexed" 3.9.2 uses 0.7s while 3.16.2 uses 1.8s; My relevant