> the pseudo code for my update is
>
[quoted text clipped - 5 lines]
> temp_table where temp_table.pk = a.pk)
> where a.pk in (select pk from temp_table)
update a set (c1, c2) = (select c1, c2 ...)
> delete from temp_table
> commit;
[quoted text clipped - 3 lines]
> degrades after each loop, but if temp_table is created as a regular DB2
> table we see a consistent performance.
This is APAR# IY77333 fixed in FP11 (never mind the description. It's
too narrow).
DB2 keeps adding rows to the end despite the delete because temp tables
are implicitly defined as APPEND ONLY. So you keep scanning more and
more empty space.
In FP11 DB2 detects a DELETE without WHERE clause on such a temp and
truncates.
However you would be better of declaring the table as ON COMMIT DELETE
ROWS. Simply skip the DELETE. Let COMMIT truncate for you.
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab