Subject Re: [IBO] Fastest Count
Author Bill Gage
FYI Svein,

I researched the suggestion of pregenerating counts and found a way
to create a prepopulated count table. I identified some of the core
groupings that occur and make counts off of those. The fortunate
thing is that the table that the counts are being based off of is
filled once when the database is created and then records are not
added or removed. So pregenerating the counts will speed things up
a bit.

Thanks
Bill

--- In IBObjects@yahoogroups.com, Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
>
> --- In IBObjects@yahoogroups.com, "Bill Gage" wrote:
> > Well our databases are so huge that we have to split them down
into
> > separate databases for each month.
>
> Oops, exactly how huge is "huge"? Counting records is generally
slow
> in client/server databases like Firebird and should be used with
care.
> Firebird has to look up every record (to see whether it is visible
to
> the transaction that does the 'select count'). Hence, if you're
> talking about counting more than a million records or so
(depending on
> lots of stuff, e.g. if you're the only user and are patient enough
to
> wait for a long time, you could do select counts on 100 million
> records or more, whereas counting 100000 records could be
unacceptable
> in a system with lots of concurrent users), you may find that you
have
> to restrict which counts should be allowed.
>
> Set