Subject Re: [firebird-support] Select count(*) using pk
Author Helen Borrie
At 07:44 PM 9/02/2005 +0200, you wrote:

> >>There's nothing to speed up count (*) it's rather a no-no. ;-)
>
>Well, in FB there is nothing, but theoretically, if we think in abtract
>way : automatic counter for each table
>record_count++ on insertion, and record_count-- on deletion, and retrieval
>that counter from select count(*) ...
>would be much faster. (especally with 14 mil. records :))

But it could never be considered accurate...no transaction can see pending
inserts by other transactions...what if transaction nnnn performs 10,000
inserts and then rolls back? Stand inside any transaction and try to work
out what a record count really means...

./hb