If an app has a local database that contains a large number of rows (I'm thinking hundreds or thousands of rows, but let's say a million or billion for the sake of argument), will returning all rows from a sql query to a cursor and using that to populate a ListView negatively affect performance?
Note that (1) I'm not talking about returning all columns, which is discussed here:
Also (2), I'm not talking about performance issues related to creating too many views. I understand the importance of recycling views as is discussed here:
- Performance issue with ListView and CursorAdapter for large amount of data
- HowTo: ListView, Adapter, getView and different list items’ layouts in one ListView
And (3), I'm not talking about getting data from a remote server where a slow network is a concern. The app has it's own local database.
So basically I'm asking if the cursor adaptor has anything built in to continue querying the database or does it return all the data at once. That is, should I just return, say, 100 rows at a time and then requery the database for the next 100 rows when the user scrolls to the last row?
In my particular case, I am making messaging app that saves a history of all previously sent messages. Users can view all sent messages in a ListView.