I have sqlcipher SQL code that is relatively complex (27 tables) but with few records (between 50-200 records per table). When I run a SELECT statement (the same as in the corresponding view), joining 3 tables, executing a pair of "LIKE" (optimized using EXPLAIN), the desktop client CPU (with sqlcipher) takes 3 ms to query.
However, the same Android query with Cordova-SQLitePlugin takes almost 1900 ms - due to the fact that opening the database costs about 1800 ms , which, obviously, is repeated after each page load.
Requests are issued as follows:
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 tips and tricks ...
Greetings from Chris
source
share