I assume you appreciate the fact that just knowing SQL is not knowing how to
optimize queries.

I'm also going to assume that the read queries are the issue. Insert and
delete queries are a whole different issue with respect to indexing.

Indexes are indeed the primary means of optimizing SQL queries. I'm
wondering if the create index command you ran on the PC is actually in
effect on the Android device. If I'm not mistaken, you should be able to
verify that the DB on the device actually has indexing enabled. Have you
verified the speedup that indexing provided on the PC?

If adding column indexing by itself is not effective, you'll need to look
into the queries and the actual data patterns. Some queries are structured
so that the DB cannot use indexes. See if sqlite has an "analyze" command
for debugging queries. It will show the steps it would use to execute the
query. If there's no step that uses the index (even if there is a column
index) or if the index lookup is at the end of the steps, then the query is
not making maximal use of the index. It's a bit of an art to coerce the
query compiler to do it right and sometimes there are pitfalls in SQL that
need to be understood.

How many queries does you app use? Which one is the bottleneck? Can you post
the query?

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

Reply via email to