Re: BUG #2658: Query not using index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



gdavis@xxxxxxxxxxxxxxx (Graham Davis) writes:
> 40 seconds is much too slow for this query to run and I'm assuming
> that the use of an index will make it much faster (as seen when I
> removed the GROUP BY clause).  Any tips?

Assumptions are dangerous things.

An aggregate like this has *got to* scan the entire table, and given
that that is the case, an index scan is NOT optimal; a seq scan is.

An index scan is just going to be slower.
-- 
let name="cbbrowne" and tld="linuxdatabases.info" in String.concat "@" [name;tld];;
http://cbbrowne.com/info/linux.html
"The computer is the ultimate polluter: its feces are
indistinguishable from the food it produces." -- Alan J. Perlis


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux