Description
Submitted by: Andreas Rosenbaum (anros)
Jira_subtask_outward CORE2236
Attachments:
core-1801.zip
Sweep can take a long time after updating the same record many times while another transaction was open.
Steps to reproduce:
1) Preparation
create table testtable
(
pk integer not null,
dtvalue date
);
alter table testtable add constraint pk_testtable primary key (pk);
create index idx_dtvalue on testtable (dtvalue);
insert into testtable(pk, dtvalue)
values (1, current_timestamp);
2) open transaction 1
3) update record
open transaction 2
"update testtable set dtvalue = current_timestamp where pk = 1;"
commit transaction 2
repeat step 3 100.000 times
4) commit transaction 1
5) trigger sweep
select * from testtable
Result: fbserver uses 100% CPU for several minutes (up to several hours when adding more columns and indizes to testtable)
The problem does not occur without index "idx_dtvalue" or with firebird 1.5.3