Subject Re: [firebird-support] Logging time spent in trigger
Author Ivan Prenosil
Something like this:

TS = GetExactTimestamp();
... your code ...
INSERT INTO LogTable (TriggerName, TimeInSeconds)
VALUES ( 'This Trigger', (GetExactTimestamp() - TS) * 24 * 60 * 60);

You should use UDF (GetExactTimestamp from fbudf.dll),
since precision of 'NOW' is whole seconds,
and CURRENT_TIMESTAMP is constant during command execution.


----- Original Message -----
From: "yellowsquirrel42" <bjoern@...>
To: <>
Sent: Tuesday, August 24, 2004 11:57 AM
Subject: [firebird-support] Logging time spent in trigger

> Hi all,
> i'm not an experienced sql user and new to firebird. Maybe someone has
> a simple solution for my problem.
> I have a firebird database with many triggers. One of my tables is
> named Patient. If i delete all patients in the table, a cascading
> delete will occur and rows from other tables will be deleted aswell.
> The problem is that a statement like
> delete * from Patient;
> lasts very long (about 30 minutes for 400 rows). Is there a simple
> approach to log the time each trigger in the cascading delete needs ?
> Bjoern