Speed up database access

Post Reply
User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Speed up database access

Post by Vadi »

I noticed for one person, executing an sqlite update statement was slowing down with time (up to 10ms per update query). They were on an SSD, so not a slow drive, and restarting Mudlet would give the expected speeds again. After some Googling, I found the PRAGMA synchronous option, which upon setting to off, seemed to fix this. It could be some weird win8/sqlite interaction or just win8 being buggy, not certain. Either way, if you run into this, doing this seems to be workaround (at the dangers of data loss, please read the link to know what you're doing first).
Code: [show] | [select all] lua
db.__conn["<database name in lower case>"]:execute("pragma synchronous = OFF")
This is only for user-made databases made with db:! Not Mudlets map database (which doesn't use sqlite) or anything else.

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Speed up database access

Post by demonnic »

I haven't run into this myself, but I notice that the page linked to says the default is full synch, did you try normal before going to off? If it works well enough in normal then you'd get a reduced risk of corruption/data loss.

Post Reply