Subject | Re: [firebird-support] If Not SELECT COUNT(*), Then What? |
---|---|
Author | Martijn Tonies |
Post date | 2008-12-10T10:21:30Z |
Hi,
Why do you use COUNT anyway?
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com
> I had a bug in a function that is passed a tableNot in particular... The real question would be:
> name and a where clause, and returns a count of the
> records that qualify for the where clause, if one is
> passed in.
>
> The function builds an SQL of
>
> SELECT
> COUNT(*) FROM
> <Table Name>
> WHERE <--------- If where clause passed in
> <Where Clause>;
>
> While tracking down the problem I read in Helen's
> book that SELECT COUNT(*) is inefficient.
>
> Should I re-think the use of COUNT(*) in this
> function?
Why do you use COUNT anyway?
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com