Subject | Re: [firebird-support] Select count(*) using pk |
---|---|
Author | Lucas Franzen |
Post date | 2005-02-09T16:38:06Z |
Dirk,
dirknaudts schrieb:
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.
dirknaudts schrieb:
>select count (*) isn't faster or slower than select count (primary_key)
> 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.
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.