Hello

Why does SQLite consume 2.5MB memory every time when running a statement on a 
attached database with LIKE operator?

Example 1:
SELECT fs_rec FROM fs_main WHERE fs_itemtype=? AND fs_textid LIKE ?;            
// consumes <50kB RAM

Example 2:
SELECT fs_rec FROM _job01.fs_main WHERE fs_itemtype=? AND fs_textid LIKE ?;     
// consumes 2.5MB RAM
SELECT fs_rec FROM _job02.fs_main WHERE fs_itemtype=? AND fs_textid LIKE ?;     
// consumes 2.5MB RAM
SELECT fs_rec FROM _job03.fs_main WHERE fs_itemtype=? AND fs_textid LIKE ?;     
// consumes 2.5MB RAM
SELECT fs_rec FROM _job04.fs_main WHERE fs_itemtype=? AND fs_textid LIKE ?;     
// consumes 2.5MB RAM

Example 3:
SELECT fs_rec FROM _job01.fs_main WHERE fs_itemtype=? AND fs_textid=?;          
// consumes <1KB RAM

Memory is consumed immediately after the first sqlite3_step() is called. 

The PRAGMA cache_size is set to 2000 on the in-memory main database.

Regards
Daniel


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

Reply via email to