Is there any possibility that the attached db already existed before
you ran this?  Because once a db exists (contains pages) the page size
is fixed until you run vacuum.

On Tue, Aug 16, 2016 at 10:53 AM, Ward WIllats <sqlite-us...@wardco.com> wrote:
>
>>> On Aug 12, 2016, at 11:44 PM, Dan Kennedy <danielk1...@gmail.com> wrote:
>>>
>>> On 08/13/2016 01:14 AM, Ward WIllats wrote:
>>>
>>> Can't reproduce this problem here. Are you able to reproduce it with the 
>>> shell tool?
>>>
>>
>>
>> Yes, if I use the shell on our embedded system (OpenWRT/Linux). I should 
>> have added that:
>>
>> 1. The main DB in on a JFFS filesystem and we've moved the -shm file onto 
>> /tmp with a marginally-supported sqlite #define.
>> 2. The secondary DB is on /tmp in a RAM FS (which is larger/faster/volatile).
>>
>> We actually issue quite a few pragmas on open. I'll post the whole sequence 
>> when I can get back to our box.
>>
>
> Here we go:
>
> ~# /usr/local/bin/sqlite3 /opt/foundation/core_db.db
> SQLite version 3.10.1 2016-01-13 21:41:56
>
> Enter ".help" for usage hints.
> sqlite> attach database '/tmp/RareData.db' as rd;   <---- ATTACH SECOND DB
> sqlite>
> sqlite> pragma page_size=512;           <----- SET MAIN DB PAGE SIZE
> sqlite> pragma cache_size=200;
> sqlite> pragma mmap_size=0;
> 0
> sqlite> pragma busy_timeout=57000;
> 57000
> sqlite> pragma foreign_keys=ON;
> sqlite> pragma synchronous=normal;
> sqlite> pragma journal_mode=WAL;
> wal
> sqlite> pragma temp_store=2;
> sqlite> pragma waL_autocheckpoint=10;
> 10
> sqlite> pragma journal_size_limit=15360;
> 15360
> sqlite> pragma auto_vacuum=2;
> sqlite> pragma max_page_count=16384;
> 16384
> sqlite>
> sqlite> pragma page_size;
> 512                                       <---- MAIN DB PAGE SIZE OK
> sqlite>
> sqlite> pragma rd.page_size=4096;         <----- SET ATTACHED DB PAGE SIZE TO 
> 4K
> sqlite> pragma rd.cache_size=32;
> sqlite> pragma rd.mmap_size=0;
> 0
> sqlite> pragma rd.busy_timeout=57000;
> 57000
> sqlite> pragma rd.foreign_keys=ON;
> sqlite> pragma rd.synchronous=normal;
> sqlite> pragma rd.journal_mode=WAL;
> wal
> sqlite> pragma rd.temp_store=2;
> sqlite> pragma rd.waL_autocheckpoint=2;
> 2
> sqlite> pragma rd.journal_size_limit=16384;
> 16384
> sqlite> pragma rd.auto_vacuum=2;
> sqlite> pragma rd.max_page_count=5000;
> 5000
> sqlite>
> sqlite> pragma rd.page_size;
> 1024                                   <------ GET 1K DEFAULT PAGE SIZE BACK 
> ON ATTACHED DB, *NOT* 4K SET ABOVE
> sqlite>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to