You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- You code looks OK to me; you might need to profile your code to get more information on where the bottleneck is e.g. is it performing the sqlite statement or is it archiving the item?deanWombourne– deanWombourne2010-03-15 09:53:46 +00:00Commented Mar 15, 2010 at 9:53
- (Though the while(YES) smells a bit - why not just do the request and see what result is - why do you need the while at all?)deanWombourne– deanWombourne2010-03-15 09:54:36 +00:00Commented Mar 15, 2010 at 9:54
- I was under the impression that the interface might be stuck in the SQLITE_BUSY state for awhile, and that I shouldn't simply proceed until the transaction is actually over. It could possibly be archiving, but I have another transaction that runs a delete query instead, and thats slow too. I'll try running the inserts without encoding the dictionary data and see how it goes.akaii– akaii2010-03-15 10:04:37 +00:00Commented Mar 15, 2010 at 10:04
- Even without the archiving, a hundred inserts are taking up to 5 seconds to complete. I don't know if this is normal, but at this rate, I'll have no choice but to stuff the whole database module in a thread... Does anyone have a better solution for this? It seems inconceivable that transactions could be taking this long... And sqlite seems to be the only way I can manage large amounts (40+MB) of data without keeping it all in memory at the same time. Core Data doesn't allow me to get rid of objects without loading it into memory first, and uses sqlite as a base anyway.akaii– akaii2010-03-15 10:12:56 +00:00Commented Mar 15, 2010 at 10:12
- I've suddenly found that I have an even worse problem on my hand. sqlite3_bind_blob is apparently failing for some reason, silently. When I store the blob, the NSData object's length is in the thousands (KB range). When I get it back, it's been truncated to 10 bytes. When I check the DB through SQLite Browser, most of the data is gone (I can recognize the keys in the record if I store the dictionary as NSPropertyListSerialization, but the values are gone). This happens regardless of whether I use NSPropertyListSerialization or NSKeyedArchiver to serialize my data.akaii– akaii2010-03-16 03:53:03 +00:00Commented Mar 16, 2010 at 3:53
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. python-3.x), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-sql