On Fri, Aug 9, 2013 at 1:55 PM, Andrew Beal <ab...@whoi.edu> wrote: > Hi All, > > Is there a way within SQLite to configure how many bytes each interaction > with the IO layer occur as? According to the > http://www.sqlite.org/atomiccommit.html doc, SQLITE does sector writes > and that is configured by the xSectorSize function within the IO Methods > object. From the behavior I have observed, SQLite is not using that value > for the RW interactions with the VFS layers. I am seeing it use the size of > the database page instead for IO operations which is nice, however my > hardware doesn't like that size of access. > > Am I misunderstanding the behavior? Or is sqlite supposed to use the page > size and the documentation is incorrect? >
SQLite journals entire "sectors" (whatever the sector size is reported by from the VFS). But it writes a page at a time. If your hardware wants to be written as sectors and if the page size is less than the sector size, then you'll need to do appropriate buffering inside your VFS. (Or, maybe just make sure all your database files have page sizes that are at least as big as your sectors.) Note also that only the database file is written in page-size chunks on page-size boundaries. The rollback journal is written sequentially and with non-page-size chunks and on non-page boundaries. Again, if your hardware/OS cannot deal with that, you'll need to buffer the writes in your VFS. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users