Subject Re: [firebird-support] Why does it take hours to perform a select count(*) on a table with 586,000 recs
Author Thomas Steinmaurer
> I have a table with 586,000 records. When I try to get a record count
> using select count(*) from table, it takes hours. Why is this? How can
> I get a quick count?

A count(*) requires a full table scan, that means, visiting all records
in the table. Even with 586.000 records, it should be in a range of
seconds I think. You might get beaten by garbage collection. Any chance
that there were a lot of frequent manipulation operations on that table?



--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com