> Anyway, on my machine it seems that the per-tuple CPU costs for SELECT
> COUNT(*) with an index-only scan are something like 10% higher than the
> per-tuple costs with a heap scan. We might get that down to roughly par
> with some hacking, but it's never going to be vastly better. The
> argument in favor of index-only scans is mainly about reducing I/O costs
> anyway.
Well, if it's not CPU costs, then something else is eating the time,
since I'm seeing per-tuple COUNT counts on indexes being 400% more than
on heap.
In the airport you said something about index-only scan not scanning the
tuples in leaf page order. Can you elaborate on that?
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com