Subject Re: [firebird-support] Select count(*) using pk
Author Lucas Franzen
Dirk,

dirknaudts schrieb:
>
> Hi All,
>
> It seems that doing a select count(*) from mytable, where mytable has
> a pk, FB 1.5.1 doesn't use that PK to speed up the count.

select count (*) isn't faster or slower than select count (primary_key)
since in both cases the whole table has to be scanned and every record
has to be looked at if it's valid within the transaction (if so count is
increased) or not.

There's nothing to speed up count (*) it's rather a no-no. ;-)

Luc.