Subject | Short or long transactions |
---|---|
Author | burmair |
Post date | 2008-09-03T18:26:33Z |
Hi,
I have to update a DB with a lot of small changes (usually updates,
but sometimes inserts and deletes). The changes are not usually
logically related, but sometimes they are, especially for deletes. In
terms of performance, is it faster to do as much as possible in a
single transaction (or maybe a few "chunks"), or is it essentially the
same if each update is performed in its own transaction? What factors
might make a difference? The size of the rows in question? The
number of rows in the tables? The mix of update/insert/delete? Cache
size? Forced writes? Indices? Other things? I could run some
tests, but I'm not really sure what parameters can or should be adjusted.
Any advice would be appreciated!
I have to update a DB with a lot of small changes (usually updates,
but sometimes inserts and deletes). The changes are not usually
logically related, but sometimes they are, especially for deletes. In
terms of performance, is it faster to do as much as possible in a
single transaction (or maybe a few "chunks"), or is it essentially the
same if each update is performed in its own transaction? What factors
might make a difference? The size of the rows in question? The
number of rows in the tables? The mix of update/insert/delete? Cache
size? Forced writes? Indices? Other things? I could run some
tests, but I'm not really sure what parameters can or should be adjusted.
Any advice would be appreciated!