Since you are updating all of the sets with the specified part number
why not just ensure that a transaction never inserts the same part
number more than once (an INSERT ...SELECT ... WHERE NOT EXISTS(...)
comes to mind), then delete the row before the end of transaction.
Frank van Vugt wrote:
Hi Josh,
> > It seems in this case the time needed for a single deferred trigger
> > somehow depends on the number of dead tuples in the table
After further investigation I think I have a better grasp of what's going on.
The thing biting me here is indeed the 'delete from' on a table with a numb
Frank,
> It seems in this case the time needed for a single deferred trigger somehow
> depends on the number of dead tuples in the table, because a vacuum of the
> table will 'reset' the query-times. However, even if I wanted to, vacuum is
> not allowed from within a function.
>
> What is happenin
Obviously,
this part of tr_f_def():
**
-- delete the contents
-- delete from f;
IF EXISTS (SELECT 1 FROM f) THEN
DELETE FROM F;
VACUUM F;
END IF;
**
Hi,
I'm seeing the following behaviour with the table and functions given below:
db=# insert into f select * from full_sequence(1, 1000);
INSERT 0 1000
Time: 197,507 ms
db=# insert into f select * from full_sequence(1, 1000);
INSERT 0 1000
Time: 341,880 ms
db=# insert into f select * from full_se