Mac OS X, iPhone & Android Development
Speeding up SQL on the iPhone
So, while using %LIKE% is a good option for a small dataset, the iPhone doesn’t have the CPU power to trawl through a large dataset quickly. Using PHP with sqlite, we took the large data set which has a description field in it, and split it down to a type of index table. With this, we were able to use the = and get better accuracy.
Example:
Field has index of 34 and a data field of “this is the best movie we have seen”
Our PHP script split this into another table which the main search looks at:
34 this
34 is
34 the
34 best
…
34 seen
As you can see, we could look for ‘best’, get the index of 34 and pull out the result very quickly. We hope this is useful to someone out there!
| Print article | This entry was posted by admin on 29/12/2009 at 15:09, and is filed under Codetalk, iPhone. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 7 months ago
This was very useful. Thanks for the tip!