5

I am asking this question because some answers on StackOverflow are not the ones I am looking for. My issue is that in early versions of Android like 2.3, the query is very slow and I get this message.

My Error Message 06:37:25.521: ERROR/CursorWindow(322): need to grow: mSize = 1048576, size = 45, freeSpace() = 43, numRows = 8928 07-12 06:37:25.521: ERROR/CursorWindow(322): not growing since there are already 8928 row(s), max size 1048576

This message does not happen on Android 3.0+ for me I think, but it still takes a long time to do the query, so I am looking into using limits. It works almost flawlessly on Android 4.0+ though without limits. I am using SQLite FTS3 MATCH queries as well.

The reason I have 8928 rows is because I'm doing search suggestions and someone can input a "t" and get 8928 rows or something even larger, which freezes up Android 2.3 apparently. I cannot limit my search suggestion threshold because some results with only two characters may have 20 results or 20000+ depending on what it is.

Android SQLite and huge data sets

This link is probably the best place for answers. The last answer in the given link seems promising, but there is no way to get the number of rows unless you do cursor.getCount(), which requires you to get the total number of rows from a big query (ex. 20000+ results), unless I'm thinking about it wrong. Is there some workaround to this? How would you do this in code to solve the CursorWindow problem?

Community
  • 1
  • 1
John61590
  • 1,106
  • 1
  • 13
  • 29
  • What would you want to do with 20000 result records? You *cannot* display that many suggestions on a phone screen. – CL. Jul 12 '13 at 12:58
  • I'm doing 60000+ now on my Nexus 7 tablet. I'm pretty sure there's a way to do it on other devices somehow... I know no one can look through all of it, but that's just what happens when you do search suggestions. – John61590 Jul 12 '13 at 13:12
  • Update: didn't really solve the issue, but I ended up limiting the cursor results to 3000, since I think that is a good number. – John61590 Mar 26 '14 at 13:05

0 Answers0