{ "id": "64051", "key": "TIMOB-3419", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2017-07-27T21:05:33.000+0000", "created": "2011-04-15T03:44:54.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect", "klist", "reported-1.6.1", "rplist", "sqlite" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-07-27T21:05:33.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

A helpdesk\r\nticket has reported that inserting rows in a SQLite database\r\ntakes too long. I have create a sample app and ran it against both\r\nAndroid and iOS. This is the code: link to the\r\ncode

\r\n

And in this\r\nimage you can see the difference between both platforms in\r\nmilliseconds after the insert.

\r\n

Tested Agains iPhone Simulator 4.3 and Android APIs 2.2
\r\nTitanium SDK 1.6.1

{html}", "attachment": [], "flagged": false, "summary": "Android - SQLite insert is very slow", "creator": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "133456", "author": { "name": "fluff", "key": "fluff", "displayName": "fluff", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is still the case in 1.7.0/upstream.. Any love/fix coming?", "updateAuthor": { "name": "fluff", "key": "fluff", "displayName": "fluff", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-11T16:19:11.000+0000", "updated": "2011-05-11T16:19:11.000+0000" }, { "id": "133470", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Significant time has been invested trying to find a speedup. The underlying implementation seems to be the gating factor. More research will be done, but it won't be fixed in 1.7.0. It may not be fixable.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-11T17:29:34.000+0000", "updated": "2011-05-11T17:29:34.000+0000" }, { "id": "178179", "author": { "name": "paul h", "key": "paul h", "displayName": "Paul Hamilton", "active": true, "timeZone": "America/Havana" }, "body": "Any updates on this? Working on a project that could send thousands of insert statements to a user. In an iphone, this takes fractions of a second. In Android this takes quite some time.\r\n\r\nusing 1.8 sdk", "updateAuthor": { "name": "paul h", "key": "paul h", "displayName": "Paul Hamilton", "active": true, "timeZone": "America/Havana" }, "created": "2012-01-05T12:50:47.000+0000", "updated": "2012-01-05T12:54:26.000+0000" }, { "id": "178225", "author": { "name": "paul h", "key": "paul h", "displayName": "Paul Hamilton", "active": true, "timeZone": "America/Havana" }, "body": "using this tip i found on stack overflow:\r\n\r\nhttp://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-time-in-an-sqlite-database. See comments 2 and 3.\r\n\r\ni was able to cut the time for 10,000 records to about 25 seconds, roughly a 1/3 reduction in time. Which is still significant... but worthwhile to note.\r\n\r\nI modified the above user's code to support multiple inserts at a time, in 500 blocks.\r\n\r\nhttp://pastie.org/3134463\r\n\r\nedit: also worth noting that while using this trick, the time for inserts on an iphone went from around 1.3 seconds to about 50ms. Worth using it all around.", "updateAuthor": { "name": "paul h", "key": "paul h", "displayName": "Paul Hamilton", "active": true, "timeZone": "America/Havana" }, "created": "2012-01-05T15:33:53.000+0000", "updated": "2012-01-06T06:57:31.000+0000" }, { "id": "424987", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing due to inactivity. If this issue still exists, please raise a new ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-27T21:05:33.000+0000", "updated": "2017-07-27T21:05:33.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }