The situation here is that I have a web sql database with 8 tables and per table an 2 indexes.
Once I start the web application I will load (ajax call) all data into the tables, for about 200 rows in each table.
After inserting, I do a select on one of the tables (select * from cars) but the problem is that the select query takes like 4 seconds in chrome and 30 seconds on my htc desire android phone (did some logging before the execute and in the success callback).
The second time it only takes a few milliseconds to execute the select query, also on the other tables.
What could it be, seems like the database isn’t ready after those initial inserts and does some magic stuff to setup or cache or write the database to disk or something?
Any ideas?
EDIT
Found the solution.. just insert all items in one transaction! Beginners mistake I think 😉
Had to add all items in one transaction.
Creating transactions for each row is very slow!