Subject Re: [firebird-support] Plan natural in select count()....
Author Fernando Medeiros
but it is really necessary, create a generator or a field in a table just to
count the records through triggers after insert / delete after.

but still think its not necessary paging many records as chamberlin said.

2009/12/19 Doug Chamberlin <dougchamberlin@...>

> adrian_avila_mtz wrote:
> > When I do a SELECT COUNT(ID) FROM EMPLOYEES I always get a natural plan
> even if I have an index for ID, how can I get fasters select count()
> queries?
> The way to get a faster result is to combine your counting with some
> other select criteria that reduces the number of records being accessed.
> In response to other messages you have indicated you need to paginate
> every record of a 3.6 million record table. Somehow I cannot believe you
> really need to generate 100,000 or more pages. So, I suspect there is
> something else you can add to the query to speed it up by selecting only
> part of the table.
> --
> Doug C.
> -----
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?


[Non-text portions of this message have been removed]