Subject | Re: [ib-support] do I need to compare in this trigger... |
---|---|
Author | Ann W. Harrison |
Post date | 2002-04-10T18:21:09Z |
At 05:59 PM 4/10/2002 +0000, csswa wrote:
to the primary key. If the answer is almost never, the
comparison wins. If the answer is most of the time, the
simple assignment wins. The answer is probably between
the two, and I'd go with the comparison. (but I doubt
that you could measure the difference.)
Regards,
Ann
www.ibphoenix.com
We have answers.
>for a trigger than silently prevents changes to a field beforeRather depends on how often you expect to find a change
>update, which is the speediest of these two:
>
>1. if new.pk <> old.pk then new.pk = old.pk
>2. new.pk = old.pk
>
>Is doing the comparison slower than simply doing version 2 every time?
to the primary key. If the answer is almost never, the
comparison wins. If the answer is most of the time, the
simple assignment wins. The answer is probably between
the two, and I'd go with the comparison. (but I doubt
that you could measure the difference.)
Regards,
Ann
www.ibphoenix.com
We have answers.