Subject | Re: [firebird-support] Logging time spent in trigger |
---|---|
Author | Ivan Prenosil |
Post date | 2004-08-24T12:16:16Z |
Something like this:
...
DECLARE VARIABLE TS TIMESTAMP;
BEGIN
TS = GetExactTimestamp();
... your code ...
INSERT INTO LogTable (TriggerName, TimeInSeconds)
VALUES ( 'This Trigger', (GetExactTimestamp() - TS) * 24 * 60 * 60);
END
You should use UDF (GetExactTimestamp from fbudf.dll),
since precision of 'NOW' is whole seconds,
and CURRENT_TIMESTAMP is constant during command execution.
Ivan
...
DECLARE VARIABLE TS TIMESTAMP;
BEGIN
TS = GetExactTimestamp();
... your code ...
INSERT INTO LogTable (TriggerName, TimeInSeconds)
VALUES ( 'This Trigger', (GetExactTimestamp() - TS) * 24 * 60 * 60);
END
You should use UDF (GetExactTimestamp from fbudf.dll),
since precision of 'NOW' is whole seconds,
and CURRENT_TIMESTAMP is constant during command execution.
Ivan
----- Original Message -----
From: "yellowsquirrel42" <bjoern@...>
To: <firebird-support@yahoogroups.com>
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 ?
>
>
> TIA
> Bjoern