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

2017-11-19 Thread Simon Slavin


On 19 Nov 2017, at 6:15am, Howard Kapustein  
wrote:

> On 10 Nov 2017, at 8:49am, advancenOO  wrote:
> 
>> hAve you optimised your column orders ?
> What is optimal?

SQLite reads only up to the last column it needs to execute the command.  So 
you put your most frequently used columns at the beginning of the table 
definition.

Have you created indexes ideally suited to your WHERE and ORDER BY clauses ?

We see a lot of people here asking about obscure complicated features of how 
SQLite works who haven’t done basic optimization things that apply to all SQL 
engines.  That’s what’s behind the questions advancenOO and I asked.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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

2017-11-18 Thread Howard Kapustein
On 10 Nov 2017, at 8:49am, advancenOO  wrote:

>hAve you optimised your column orders ?
What is optimal?

- Howard
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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

2017-11-10 Thread Simon Slavin


On 10 Nov 2017, at 8:49am, advancenOO  wrote:

> 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.

hAve you optimised your column orders ?

Have you created ideal indexes for the WHERE and ORDER BY clauses you use ?

Have you made use of covering indexes ?

Both those things speed up SQLite many times more than using memory mapping.

Have you tried SQLite just as it is, without putting special effort into 
PRAMGAs ?  SQLite is extremely fast without those things.  There’s a good 
chance it’s fast enough and you’re just wasting your time.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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 mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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

2017-11-09 Thread Simon Slavin


On 10 Nov 2017, at 5:35am, advancenOO  wrote:

> 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.

Are the threads using the same connection ?

> So, I am wondering if I can simply make the size of Wal-file a fixed size to
> support MMAP for wal-file.

What makes you think you need to use memory mapping ?  It is purely for speed 
or do you have a hardware-based reason ?  Have you tried your program without 
memory mapping to see if it’s fast enough ?

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/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 from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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

2017-11-08 Thread Dan Kennedy

On 11/09/2017 08:59 AM, advancenOO wrote:

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 can use MMAP? Why not? As I guess it can
improve the IO performance in WAL mode.


No way to do that right now. It would require a VFS interface change I 
think.


Dan.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users