title: Android DB SQLite Cursor Performance
body: <p>Using _cursor.moveToNext() to iterate through the cursor, which is taking 4-5 seconds (the sql query itself takes milliseconds).</p>
  
  <p>(Would like to avoid using cursorLoader as a workaround as I have the need to retrieve all data at once, prior to any rendering logic)</p>
  
  <p>Is there any way to speed up iterating through the cursor?</p>
  
  <p>Sample code: </p>
  
  <pre><code>Cursor _cursor = _db.rawQuery([optimized query, only takes a few ms], null);
  
  // query returns about 1000 records, cursor loop is where the bottleneck seems to be
  
              while(_cursor.moveToNext()) {
                  DtoObject obj           = new DTOObject();
                  stop.name        = _cursor.getString(0);
                  stop.last_name         = _cursor.getString(1);
      }
  </code></pre>