Two database apps, one HTML5 WebSql and one Android built with ADT. Both use exactly the same Sqlite database so same schemas, tables and indexes.
SELECT
road.description,
xy.lat AS lat,
xy.lon AS lon,
road.id_road AS id_road
FROM xy
INNER JOIN road
ON xy.id_road = road.ID_ROAD
WHERE xy.lat BETWEEN -36.89804010977648
AND -36.878040110223516
AND xy.lon BETWEEN 174.78966425022352
AND 174.8096642497765
The web app uses db.transaction. The Android SQL runs in a class that extends SQLiteOpenHelper with the database object created in an ASync process.
SQLiteDatabase dbr = this.getReadableDatabase();
Cursor cursor = dbr.rawQuery(sql, null);
if( cursor.moveToFirst()){
// loop through and analyse approx 400 results
}
Testing on HTC-1V hardware the HTML5 runs the above query in 250ms, on the Android app is takes 4000ms just to open the cursor. Is it possible to get WebSql performance from the Android app ?