On 10 October 2011 18:23, Bruce Momjian <bruce@momjian.us> wrote:
> I talked to Robert Haas and he said that index-only scans do not
> optimize COUNT(*). Is this something we can do for PG 9.2? Is anyone
> working on this?
Yes it does, provided that there is an appropriate WHERE clause. But
yes, I think we definitely want this if it's relatively easy. In
addition to this, it's not always easy to get it to use an index-only
scan even if it's going to significantly faster. I'm assuming some
supporting planner work needs to be added too.
--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company