> Given that the WAL index is mmap'ed, you're unlikely to see improvement
> in performance by storing it in heap memory. Reads/writes will go at
> main memory speeds once mapped into your address space, and under memory
> pressure, it will be no slower than if the heap was pushed to the swapfile.

Still I think pushing actual memory to swap file has bigger memory
pressure threshold than pushing cache pages that are backed by actual
file data out of physical memory. Also writing to mmaped file will
still force OS to write it to disk from time to time and that brings
additional pressure on the system overall.

>> I guess I have to do it, but I think this should be available in sqlite,
>> since it is a common case to use sqlite from single process (but
>> multithreaded), and using WAL index in memory will improve system
>> performance.

I guess it's not so common to intentionally limit yourself from ever
trying to connect to SQLite database with command line utility while
your application is working. I guess in case of keeping WAL index in
the heap such accidental connection could lead to unpredictable
behavior (maybe even database corruption).


Pavel

On Fri, Dec 10, 2010 at 9:38 AM, Christian Smith
<csm...@thewrongchristian.org.uk> wrote:
> On Thu, Dec 09, 2010 at 12:17:34PM +0200, Yoni Londner wrote:
>>
>> > The alternative is to create your own VFS that stores the WAL index in
>> > heap memory.
>> I guess I have to do it, but I think this should be available in sqlite,
>> since it is a common case to use sqlite from single process (but
>> multithreaded), and using WAL index in memory will improve system
>> performance.
>
>
> Given that the WAL index is mmap'ed, you're unlikely to see improvement
> in performance by storing it in heap memory. Reads/writes will go at
> main memory speeds once mapped into your address space, and under memory
> pressure, it will be no slower than if the heap was pushed to the swapfile.
>
> Christian
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to