Are you perhaps running multiple instances of this query at the same
time, causing contention inside SQLite?

>From what you've described, it seems possible - since AsyncTask uses a
pool of more than one thread, and you also mentioned running this
query on the UI thread as well.

I would try to use AsyncQueryHandler, which processes requests one at
a time, or some other mechanism to ensure that these queries are
serialized -- if only for the sake of debugging.

As far as finding an index, two things come to mind.

One is a cache of prior query results (perhaps using a SparseArray or
something like it) and then looking up indices in this cache.

The other is writing a count(*) type query just to get the index.

Perhaps you've already considered both, given your vast experience, if
so, my apologies for suggesting something so obvious.

-- K

21 марта 2012 г. 16:54 пользователь Zsolt Vasvari <[email protected]> написал:
> But that should effect both the UI thread query and the worker thread query.
>  But only one runs slow.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to