![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, maybe someone can shed some light on this: Env: DB2 9.7 FP2 I'd like to automatically remove entries from the EXPLAIN Tables after a couple of days. My idea was - whenever a new EXPLAIN is run it does INSERTs into the EXPLAIN_* tables so I created a trigger: CREATE TRIGGER prune_explain AFTER INSERT ON EXPLAIN_INSTANCE FOR EACH STATEMENT MODE DB2SQL BEGIN ATOMIC DELETE FROM EXPLAIN_INSTANCE WHERE EXPLAIN_TIME < (timestamp(current timestamp - 30 days)); -- END ; Due to RI rules all dependant EXPLAIN_* tables should be pruned as well. But it does not have any effect. When I do a manual insert into EXPLAIN_INSTANCE the trigger fires as expected, but not when using EXPLAIN command. Just to be sure - does EXPLAIN not use INSERT to fill EXPLAIN_* tables ? |
![]() |
| Thread Tools | |
| Display Modes | |
| |