Subject Re: [IBO] Fastest Count
Author Lester Caine
Bill Gage wrote:

> I don't think I fully understand your alternate solution. Do you
> mean to populate that table with the counts? In the situation I am
> in this is not an option because the actual SQL statement is created
> dynamically and there could be an infinite number of variations.

That is often the case, but I have some key 'counts' calculated via
triggers, and the 'dynamic' ones calculated in IB_DSQL. When I need to
calculate percentages, I have the total ( the big number ), and
dynamically calculate the smaller values. We are only talking small
amounts of time, but with sites now reaching 250000 transactions, it's a
lot quicker calculating the years total by sum of 12 monthly figures
than counting 100000 records cold ;)

Until you start hitting several years of data, it may not be a problem,
but it's worth bearing in mind if some totals ARE used regularly.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services