Use indexes and avoid LIKE (use fts table and MATCH instead)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Foto |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Hello
I just had a look at your dao classes and if you care about performance, you should really read about database indexes and avoid LIKE statements.
In a more general way, you should pay attention to your query plan (EXPLAIN QUERY PLAN) to find out which query is slow.
(remember every query performs well as long as you don't deal with a significant amount of data).
You might be interested in full text table (FTS) that lets you do search for arbitrary strings while maintaining perf.
One last thing, don't use SELECT * because when you change your schema the query will crash with unhelpful error message (or worse won't crash but will produce corrupted results).
Instead name the columns explicitly. It will also help you find every place where a specific column is used.
Cheers,
C.
Yep, the select * is because Im so lazy. I'm going to do some research about FTS.