title: Different ways of implementing search
body: <p>How would you approach when implementing search functionality for a data that is stored in local database?</p>
  <ol>
  <li><p>Prefetch whole list from database and then perform filtering on that cached list (have to created a backup variable), when user types</p>
  </li>
  <li><p>Make database query every time user types</p>
  </li>
  </ol>
  <p>There are 200-300 rows in the table. Each row contains 10-15 columns.</p>
  <p>PS: I always used to perform filtering on a cached list, mostly because I was required to show full list anyway, so the whole data set was already prefetched.</p>
  <p>Let's assume you don't have to show the whole list in the first place and only show when user start typing, is it better overall to perform database query in this case?</p>
  <p>I'm just not sure. I saw a colleague doing query.</p>
  <p>And yeah I'm too lazy to test performance of db querying. Visually there is almost no lag though.</p>
  <p>Every opinion is welcome!</p>
  <p>Thanks!</p>