Subject | Re: updates getting slower and slower |
---|---|
Author | lutz_mueller2003 |
Post date | 2004-10-25T13:54:35Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
UPDATE REPORTKONTOTAG SET SUMME=SUMME+?,MENGE=MENGE+? WHERE
FK_REPORTKONTO_ID=? AND DATUM=?
it is executed as an prepared statement with jayBird 1.5.4
the updates come from a file with 1000 lines. each line causes a
callback while the file is read. the callback method performs the
update-operation (and an insert on a different database, but the
times for the insert remain static, and commenting out the insert
makes no difference). of course i could (and propably will) sum up
the values in one file programmaticaly which would leave me with one
update per file and transaction. but the cost for an update will
still rise and become a problem sooner or later.
how come the time for an insert remains static while the cost for an
update keeps growing?
one thing i forgot to mention: after a backup/restore the time for
an update drops to the time the first update took. thats why i
thought of transactions first.
lutz
wrote:
> At 10:05 AM 25/10/2004 +0000, you wrote:1.5sec
>
>
>
> >hello,
> >i have a table with only 1 record. i run updates like "update
> >field=field+? where pk_id=?" on this record. the updates are
> >executed by one process, and come in transactions which include
> >about 1000 updates. while the first transaction takes about
> >the 100. transactions takes up to 15sec. and it gets slower andthe
> >slower. what could be the reason for this ? my first guess was
> >mga , but there are no concurrent transactions, since thestatements
> >are executed sequentially by just one process. does anybody knowShow us the
> >what is causing this decrease in performance?
>
> "update field=field+? where pk_id=?" isn't a valid statement.
> actual update statement.in a
>
> And clarify - are you performing 1000 updates on the same record
> single transaction? If yes, then the next question is: why?the actual statement ist this:
>
> ./heLen
UPDATE REPORTKONTOTAG SET SUMME=SUMME+?,MENGE=MENGE+? WHERE
FK_REPORTKONTO_ID=? AND DATUM=?
it is executed as an prepared statement with jayBird 1.5.4
the updates come from a file with 1000 lines. each line causes a
callback while the file is read. the callback method performs the
update-operation (and an insert on a different database, but the
times for the insert remain static, and commenting out the insert
makes no difference). of course i could (and propably will) sum up
the values in one file programmaticaly which would leave me with one
update per file and transaction. but the cost for an update will
still rise and become a problem sooner or later.
how come the time for an insert remains static while the cost for an
update keeps growing?
one thing i forgot to mention: after a backup/restore the time for
an update drops to the time the first update took. thats why i
thought of transactions first.
lutz