bits about life, coding and stuff
Small change, BIG impact. Remember there’s SQLite sitting under your wrapper. So don’t do chained OR’s.
An expression like ”
x='A' OR x='B'” will not make use of an index on column x. Instead use ”
x IN ('A', 'B')“.
Whoops. Changed and now queries run *much* quicker. (with an index on the uid)
See the SQLite optimization FAQ and the guide about NSPredicate
As a bonus, i changed my code from 6 to just one line
Related posts: