Subject | RE: [ib-support] Record Count |
---|---|
Author | Ann W. Harrison |
Post date | 2001-11-07T23:11:01Z |
At 11:53 AM 11/8/2001 +1300, Sandeep wrote:
not the same. Count(*) returns the number of rows in the table
while count(<field>) returns the number of rows which have a non-null
value for <field>. As for the index, though it will help in other
databases, Firebird and InterBase can not use an index to accellerate
a count.
Regards,
Ann
www.ibphoenix.com
We have answers.
> >Are you sure? Do remember that count(*) and count(<field>) are
> > Due to the Multi-Generational Architecture of Firebird/IB, a record
> > count can require a fair bit of processing ...
>
>Having a fieldname in count which has index on it gives a better
>performance than one without index
not the same. Count(*) returns the number of rows in the table
while count(<field>) returns the number of rows which have a non-null
value for <field>. As for the index, though it will help in other
databases, Firebird and InterBase can not use an index to accellerate
a count.
Regards,
Ann
www.ibphoenix.com
We have answers.