title: What is the fastest way to load 10000 rows from the SQLite database?
body: <p>What is the fastest way to load 10,000 rows from a SQLite database into memory? Each row has 1 text and 4 integers. Currently, I'm doing this:</p>
  
  <pre><code>while(!cursor.isAfterLast()) {
      cursor.copyStringToBuffer(column_index_1, buffer);
      cursor.copyStringToBuffer(column_index_2, buffer);
      cursor.copyStringToBuffer(column_index_3, buffer);
      cursor.copyStringToBuffer(column_index_4, buffer);
      cursor.copyStringToBuffer(column_index_5, buffer);
      cursor.moveToNext();
  }
  </code></pre>
  
  <p>The above code takes about 750 ms on Galaxy Nexus. On older devices it could be couple of times slower. Can I make it faster?</p>
  
  <p>(At this point, you're probably typing something like "Why do you need to load the rows into memory?" It's a bit complicated but I can try to explain if someone's interested. Edit: here's the explanation: <a href="https://gist.github.com/fhucho/af355d56ae3145e3e30f" rel="nofollow">https://gist.github.com/fhucho/af355d56ae3145e3e30f</a>)</p>