Subject Re: [firebird-support] Re: Why "SELECT FIRST 1 ..." and "EXISTS ( SELECT * FROM ... )" are so slow in a big database?
Author Lester Caine
Antti Nivala wrote:

> The workaround of having a manual count field is one possibility, but I
> am still looking for a more efficient and elegant solution. Is there
> one?

For the situation you are describing, the count field DOES sound like an
efficient and elegant solution ;) It only accesses a single record to
update or check a PV_TYPE. Having triggers built in is the best way of
managing some of this stuff, tailored to your requirements.

--
Lester Caine - G8HFL
-----------------------------
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop -
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php