Hello,

If I open a SQLite database in memory (using :memory:), would it be  
possible to save it on disk? Here's the reason:

Using a file-based SQLite database:

2008-11-08 15:15:44.180 XML2Plist[5554:10b] Number of XML documents  
converted successfully: 2861
2008-11-08 15:15:53.053 XML2Plist[5554:10b] Object count: 2861
2008-11-08 15:15:53.054 XML2Plist[5554:10b] Value count: 116914
2008-11-08 15:15:53.055 XML2Plist[5554:10b] Average number of  
attributes: 41
2008-11-08 15:15:53.055 XML2Plist[5554:10b] Average dictionary  
throughput: 325 (dict/sec)
2008-11-08 15:15:53.056 XML2Plist[5554:10b] Average insertion  
throughput: 13614 (rows/sec)
2008-11-08 15:15:53.056 XML2Plist[5554:10b] Store size: 17953792
2008-11-08 15:15:53.057 XML2Plist[5554:10b] Total time to add 2861  
objects: 8.798 seconds

Using a memory-based SQLite database:

2008-11-08 15:14:42.695 XML2Plist[5536:10b] Number of XML documents  
converted successfully: 2861
2008-11-08 15:14:45.275 XML2Plist[5536:10b] Object count: 2861
2008-11-08 15:14:45.276 XML2Plist[5536:10b] Value count: 116914
2008-11-08 15:14:45.277 XML2Plist[5536:10b] Average number of  
attributes: 41
2008-11-08 15:14:45.278 XML2Plist[5536:10b] Average dictionary  
throughput: 1114 (dict/sec)
2008-11-08 15:14:45.279 XML2Plist[5536:10b] Average insertion  
throughput: 46637 (rows/sec)
2008-11-08 15:14:45.279 XML2Plist[5536:10b] Store size: 0 (*)
2008-11-08 15:14:45.280 XML2Plist[5536:10b] Total time to add 2861  
objects: 2.568 seconds

(*) It's zero because I'm not aware of an API that will allow me to  
find out the size of memory-based databases.

Manipulating data in memory is ~3.4x faster than using the file system  
(YMMV). If I could process the bulk of the data in RAM, then I could  
save the final database on disk saving precious time.

Any ideas?

Thanks in advance,

-- Tito
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to