I'm creating Android application that contains a large amount of data. It takes lot of time to access the data. What are optimization technique that I can use ? Are there any optimized queries?
-
1you are going to have to ask something a bit more specific – Sam Saffron Jul 15 '09 at 06:39
4 Answers
This page will give you a lot of good tips on how to optimize SQLite things:
http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html
Keep in mind that some stuff SQLite will optimize for you as well when it runs a query:

- 15,098
- 21
- 65
- 96
-
Please don't add links as answers, rather put a bit of key info from the page and reference. Often these links change... – tread Jul 22 '15 at 14:38
Use parameterized queries to reduce the amount of queries that needs to be parsed, see: How do I get around the "'" problem in sqlite and c#?
-
i cannot use parameterized queries in sqlite for android database,is there anyother options for Query optimisarion – Rakesh Jul 16 '09 at 06:03
-
Are you sure? I don't know Android. I assumed there is only one kind of Sqlite. – Theo Jul 16 '09 at 07:12
SQLite does not support dates natively (SQLite uses strings to store dates). If you are using an index to access dates - you'll get slow query times (not to mention inaccurate or wrong results..)
If you really need to sort through dates then I'd suggest you create separate columns for the various date elements that you want to index (like years, months, and days). Define these columns as integers and add INDEX statements to index their contents.

- 39,603
- 20
- 94
- 123

- 1,139
- 6
- 10
-
Liron, you should add details of your utility to your user profile. – Toby Allen Dec 06 '09 at 18:21