2

I have a database (sqlite) where I do this query :

String query = "SELECT * FROM "+DATABASE_TABLE+ " WHERE " +COLUM_NAME + "= ?" ;

then I set the Java Object accordinly, but I have a small problem. Its so slow. I have no idea why this one time query takes 1 - 2 sec.

Is there any feature of android where I am able to upgrade this speed ?

juergen d
  • 201,996
  • 37
  • 293
  • 362
user2629828
  • 685
  • 1
  • 8
  • 13

1 Answers1

7

Indexing made my queries about 400x faster.

Here you'll find a nice tutorial: http://www.tutorialspoint.com/sqlite/sqlite_indexes.htm.

Index all the fields involved in WHERE clauses as well as all those used for joining tables.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115