Subject | Re: [firebird-support] Performance insert and update |
---|---|
Author | Ann W. Harrison |
Post date | 2005-12-30T19:32:52Z |
nas@... wrote (many many times!):
faster than updates in general.
An insert creates a single record version. An update creates a
new record version and alters the previous version to be a back
version. That may be as simple as creating a pointer to the
old version or it may involve transforming the old record to a
"delta" representing the byte-wise changes necessary to change
the new version to the old. Old version handling may also
involve "moving" the old record or delta to a different page.
An update will also create a future cost of removing the back
record.
So how could an update be faster? If the table is heavily
indexed and the indexed fields are not changed, the update
will create a new primary record and a delta, but won't
need to touch indexes.
Inserts are non-blocking (generally, though they can be made
blocking by the ill-advised requirement for monotonically
increasing primary keys). Updates can and often do created
conflicts between concurrent transactions.
Regards,
Ann
>Not calculated, but by analysis of the design ... Inserts are
> what is the better performance procces insert or update may be anyone
> have calculated ?
faster than updates in general.
An insert creates a single record version. An update creates a
new record version and alters the previous version to be a back
version. That may be as simple as creating a pointer to the
old version or it may involve transforming the old record to a
"delta" representing the byte-wise changes necessary to change
the new version to the old. Old version handling may also
involve "moving" the old record or delta to a different page.
An update will also create a future cost of removing the back
record.
So how could an update be faster? If the table is heavily
indexed and the indexed fields are not changed, the update
will create a new primary record and a delta, but won't
need to touch indexes.
Inserts are non-blocking (generally, though they can be made
blocking by the ill-advised requirement for monotonically
increasing primary keys). Updates can and often do created
conflicts between concurrent transactions.
Regards,
Ann