I am trying to implement a dictionary application on Android. As user enters a letter into the EditText (or deletes a letter), application queries the database and shows all entries begining with the text in EditText. Since the database I am using contains more than 80000 rows, performance of the query is not as good as I want. However the real problem occurs when user deletes characters from EditText. Hence I thougt to store Cursor objects in a Stack. When user deletes a character, application pops the previous Cursor from stack and uses it. Is it a bad idea to store a Cursor object returned from a SQLite query?
Share
SQL database may be not right tool at all for this purpose as query using “like” is not really perfomant in relational database. You may get better performance, if you denormalize your data by storing (and indexing) prefixes for each entry. And not forget to add kind of score, to prioritize entries (say, if entry was choosen give it higher score)