> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Brown, Daniel
> Sent: Thursday, August 07, 2008 12:27 AM
> To: General Discussion of SQLite Database
> Subject: [sqlite] Loading a existing database 100% into memory
> 
> Good afternoon list,
> 
> I would like to load my current database file completely into 
> memory, mostly as an experiment to check SQLite's maximum 
> memory footprint, however searching through the documentation 
> I can only find references about how to create new databases 
> that are completely memory resident.
> Is there a way to do this?  I'm currently using the SQlite 
> console application for my testing if that makes a difference.
> 

What do you mean by loading it into memory?
If you want to dump the on-disk tables into memory and also want to
check the memory footprint used for caching try this:

Open the :memory: database and attach the on-disk database with
ATTACH filename.db AS filename

Then do a 
CREATE TABLE tableName AS SELECT * FROM filename.tableName
On each table in the file, thus creating an in-memory copy of the DB and
having done a select on each table (i.e. you'll see how much cache in
memory will be used, etc.)

You can enumerate all tables in a your on-disk-file in the mentioned
scenario by doing a "SELECT tbl_name FROM filename.sqlite_master WHERE
type = 'table'".

Best regards,
Stefan.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to