I have a sqlcipher DB which is relatively complex (27 tables) but with little entries (between 50-200 entries per table). When I'm running a SELECT statement (same with the corresponding view), joining 3 tables, doing a couple of "LIKE's" (optimized with EXPLAIN), the desktop client CPU (with sqlcipher) takes 3ms for the query.
However the same query on Android with the Cordova-SQLitePlugin takes almost 1900ms - due to the fact opening the database costs about 1800ms, which obviously is repeated after every page load.
The queries are issued like this:
var db = window.sqlitePlugin.openDatabase({name: "myDatabase", key: "mySecret", bgType: 1});
db.transaction(function(transaction) {
transaction.executeSql(query, [],function(transaction, result) {
callback(result);
}, null);
},null,null);
Is there anything I can do? Thanks in advance for any hints and clues...
Cheers Chris