Subject Re: [firebird-support] Indexing for Min and Max
Author Artur Anjos
Hi David,

> Is there a way to get count(id) to use the primary key / an index? What I
> am trying to do here is actually get the count of records very fast - I
> have up to a million records in there.

count(*) will make the engine do something more than counting, so you will
have always this delay. (Look in IBPhoenix for more information about this,
spesial focus on deleted records).

If you need this info very often, may I suggest to create a table with this
info, and update this table with triggers after insert / after delete on
your big table. This will solve your speed problems.