View previous topic :: View next topic |
Author |
Message |
Tenkawa
Joined: 25 Aug 2005 Posts: 15
|
Posted: Wed Sep 14, 2005 18:39 Post subject: Something I noticed with SQLITE when I was porting code. |
|
|
Am I mistaken or is the SQLITE routine in the Windows NWNX doing the following.
Open File
Run all transactions until nwserver closes
Commit transactions to DB.
Close file
It seems to me that using this method is kind of a waste. The way I wrote it auto commits every transaction. Unless you commit the transaction another DB reader cannot see the changes made during the writer's session.
I may be wrong but I don't see a 'COMMIT' till the disconnect function.
Tenkawa |
|
Back to top |
|
|
Primogenitor
Joined: 08 Jan 2005 Posts: 88
|
Posted: Thu Sep 15, 2005 11:57 Post subject: |
|
|
Nope thats the way it works. SQLite is much quicker than MySQL inside a transaction, because its mainly in memory rather than on disk. You can manually issue COMMIT and BEGIN commands to manage your own transactions. If your autocommitting each SQL command, then that can be more inefficient if you are running the same command every heartbeat for every player (location tracking for example) rather than just using a transaction to put all the data in the DB in one go. |
|
Back to top |
|
|
Tenkawa
Joined: 25 Aug 2005 Posts: 15
|
Posted: Thu Sep 15, 2005 13:59 Post subject: |
|
|
ok I see. You are leaving the begin and commit if desired up to the users and only forcing a commit once to make sure nothing is left out there. With a serisl process such as nwserver I doubt there will be much performance loss doing auto commits though. That explains why I saw that though thanks.
Tenkawa |
|
Back to top |
|
|
Primogenitor
Joined: 08 Jan 2005 Posts: 88
|
Posted: Thu Sep 15, 2005 16:55 Post subject: |
|
|
There is some speed data here: http://www.nwnx.org/index.php?id=doc_odbc2#V Basically, with no transactions at all, which I think is the equivalent to starting and stopping a transaction for every SQL command, SQLite slows down by almost a factor of x100. |
|
Back to top |
|
|
Tenkawa
Joined: 25 Aug 2005 Posts: 15
|
Posted: Thu Sep 15, 2005 17:01 Post subject: |
|
|
Nod. I see. |
|
Back to top |
|
|
|