Write complete pages to journal in VFS?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Write complete pages to journal in VFS?

J Decker
I've recently changed the underlaying file system driver such that it
allocates one of 2 sizes of blocks (4096 or 256), based on how much is
written to the file at a time; so a write < 2048 will allocate 256 byte
blocks instead; it's not a HUGE performance hit, but I am trying to keep it
more on the efficient side (I could maybe provide an IOCTL sort of op that
forces files to only use large blocks)

I was wondering if there was a way I could make SQLite always write full
pages to the VFS (actually I found the atomic4k option after this).  It has
(xSectorSize)

int xSectorSize(sqlite3_file*file)
{
return 4096;
}

And I found  SQLITE_IOCAP_ATOMIC4K just now,and updated to use that...

int xDeviceCharacteristics(sqlite3_file*file)
{
SQLITE_IOCAP_ATOMIC4K|SQLITE_IOCAP_SAFE_APPEND|SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN|SQLITE_IOCAP_POWERSAFE_OVERWRITE;
}


But, the -journal file doesn't respect that setting...


Write keyMaster.db-journal 512 at 0
Write keyMaster.db           4096 at 0
Write keyMaster.db           4096 at 4096
Write keyMaster.db-journal 512 at 0
Write keyMaster.db-journal 4 at 512
Write keyMaster.db-journal 4096 at 516
Write keyMaster.db-journal 4 at 4612
Write keyMaster.db           4096 at 0
Write keyMaster.db           4096 at 8192
Write keyMaster.db-journal 512 at 0
Write keyMaster.db-journal 4 at 512
Write keyMaster.db-journal 4096 at 516
Write keyMaster.db-journal 4 at 4612
Write keyMaster.db           4096 at 0
Write keyMaster.db           4096 at 12288
Write keyMaster.db-journal 512 at 0
Write keyMaster.db-journal 4 at 512
Write keyMaster.db-journal 4096 at 516
Write keyMaster.db-journal 4 at 4612
Write keyMaster.db           4096 at 0
Write keyMaster.db           4096 at 16384
Write keyMaster.db           4096 at 20480
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users