Brown, Daniel wrote: > Ok so after reading your feedback I tried: > 1. "PRAGMA cache_size =10" no change in memory usage. > 2. "PRAGMA page_size = 4096" no change in memory usage. > > I'm doing both those queries (in C++) after the 'sqlite3_open( > ":memory:", &m_pDataBase );' in my test but before the database file is > attached or anything is copied or created. The rebuilt database file is > 7.46 MB and the memory usage I'm seeing is now: 22.20 MB with a high > water of 24.55 MB as reported by the sqlite_memory_* functions. >
I believe each database has its own cache. You need to set the cache size for the file database after it is attached. attach 'file.db' as file_db; pragma file_db.cache.size = 100; In my tests I am setting the cache size for both the memory database (right after the open call) and the file database. > I'm not using the amalgamation version of the pre-processed source; I'm > using the individual source files of 3.6.1 on Windows XP with Visual > Studio 2005. I'm afraid I can't give you a copy of the test database as > it's a drop from a live product, could it be using the third party > SQLite Analyzer application to import from excel be the issue? I doubt it, but anything is possible. > Are > there any other tools from importing from a .xls to a SQLite database > (converting each sheet to a table)? > I don't know. > I just tried a "vacuum" after I detach the database from file and that > didn't reduce the memory usage either but it did double the high water > mark which after reading the documentation sounds about right for making > a temporary copy. > > How do I rebuild a database file for another page size or did the pragma > do that already? > I used you test program to do that for my database. :-) I simply changed the filename of the output database from :memory: to my new filename in the open call, and then executed a "pragma page_size=4096" immediately after the open. The rest of your code copied all the tables in the test database out to the new database file with the new page size. This database doesn't use any named (i.e, non-automatic) indexes or triggers, so there was nothing else to be copied. Dennis Cote _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users