On 3/5/16, Jim Callahan <jim.callahan.orlando at gmail.com> wrote: > > ?I am confused. > The "page" is an in-memory structure; i?t is how large a chunk the program > reads from the file (analogous to how large a scoop or shovel),
That is but one of many definitions of "page". That word "page" gets used (and misused) for a lot of things in computer programming. Like "virtual", its meaning can shift depending on context. An SQLite database file (see https://www.sqlite.org/fileformat2.html) consists of one or more "pages" of content. A "page" in an SQLite database file is not the same thing as a "page" in the virtual memory design of your CPU. But they are often roughly the same size. A key point of this email thread is that SQLite performance seems to be maximized when the database page size matches the CPU memory page size and the disk sector size - currently 4096 bytes on most hardware. > So, unless > one is using an index, how would the on disk structure be impacted? How > does SQLite handle the last block (does it expect the file to be an even > multiple of the block size, or does it accept that the last read might be > less than a full block?). > > For example, if one encountered an old file, would it be enough to rebuild > the indices? > ? > Or is it simply a matter of closing the file? (close the file with the old > version and open the file with the new?). > > I haven't read the source code so I don't know what assertions, checks or > assumptions SQLite > uses. > > Jim? > > > > On Sat, Mar 5, 2016 at 11:04 AM, <tonyp at acm.org> wrote: > >> From: Domingo Alvarez Duarte >>> I have a question, is it enough to vacuum a database to update to the new >>> page size ? >>> >> >> Apparently all you need to is "pragma page_size=4096; vacuum;" using the >> appropriate page size. >> This makes very easy to convert any(all) database(s) with a single command >> from the command-line, like so (Win7 example): >> >> for %i in (*.db) do sqlite3 %i "pragma page_size=4096; vacuum;" >> >> >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users at mailinglists.sqlite.org >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >> > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp drh at sqlite.org