Subject Re: [ib-support] How Do I count faster?
Author Roque
:. What about creating a trigger on insert/delete operations to
increment/decrement a number in another table? Is that too much expensive to
the general performance?

Roque.

"Lucas Franzen" <luc@...> wrote in message
news:3ED2896A.8AEC32C1@......
> There is no really fast way.
> It doesn't really matter if you do a count(*) or a count
> (primary_key_field).
>
> Due to the multi-generational architecture of IB/FB, there's no way to
> keep the record count in the table header - therefore asking for the
> number of records the whole table has to be scanned.
>
> If you have to use this quite often, you might think keeping the number
> in a separate table (without mentioning the downsides this might have
> furtheron...)
>
> Sorry, that's the way it is.
>
> Luc.