Interesting, I just tried that in my test application and Dennis's and I
get access violations during the vacuum command execution when trying to
resize the pages from 1k to 4k with my database or Dennis's test
database.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kees Nuyt
Sent: Saturday, August 23, 2008 8:51 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Reducing SQLite Memory footprint(!)

On Thu, 21 Aug 2008 16:29:10 -0700, you wrote:

>How do I rebuild a database file for another page size
>or did the pragma do that already?

Use PRAGMA page_size={your_new_pagesize} immediately before
a vacuum. It will change the page size of the vacuumed
database. See:

http://www.sqlite.org/pragma.html#pragma_page_size

"As of version 3.5.8, if the page_size pragma is used
to specify a new page size just prior to running the
VACUUM command then VACUUM will change the page size
to the new value."

Demo:
sqlite_version():3.6.0
--
-- new database
        PRAGMA page_size=8192;
        BEGIN;
        CREATE TABLE test (
                x integer primary key, 
                y text
        );
        INSERT INTO test (y) VALUES ('row1');
        INSERT INTO test (y) VALUES ('row2');
        COMMIT;
        PRAGMA page_size;
8192
        PRAGMA schema_version;
1
        PRAGMA page_size=1024;
        VACUUM;
        PRAGMA schema_version;
2
        PRAGMA page_size;
1024
-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
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