Reputation: 824
I will working sqlite for my project. Maybe db have one table and ~40k rows. I have some question for this.
When i was use SQLiteDatabase.openDatabase() then all rows go into the memory? or row adress maybe?(Afraid for large memory problem coz 40k rows)
When query methods then this search on memory? or on db file?
SQLiteDatabase.openDatabase() reference i use this with static is there a problem?
Finally ~40k rows Is this a problem for memory performance etc?
Upvotes: 1
Views: 57
Reputation: 1489
SQLite has only five data types and you can calculate approximate size.
By query you get cursor (pattern) with window (buffer), the size may be 1mb.
Version of android matters.
Finally, profiling can show the real picture.
Upvotes: 1
Reputation: 7749
When i was use SQLiteDatabase.openDatabase() then all rows go into the memory?
No, thats the point of databases.
When query methods then this search on memory? or on db file?
A query will only load required data temporarily to apply given filters. Not even the reult is completely loaded in to memory (unless you do so with the returned Cursor).
SQLiteDatabase.openDatabase() reference i use this with static is there a problem?
Probably not, but you should avoid to keep databases open for the entire lifetime of your process.
Finally ~40k rows Is this a problem for memory performance etc?
This is not a big number for a database. It will most certainly be no problem.
Upvotes: 3