Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: BUG #2658: Query not using index


  • From: Chris Browne <cbbrowne(at)acm(dot)org>
  • To: pgsql-performance(at)postgresql(dot)org
  • Subject: Re: BUG #2658: Query not using index
  • Date: Tue, 03 Oct 2006 15:18:36 -0400
  • Message-id: <60d599gqcz(dot)fsf(at)dba2(dot)int(dot)libertyrms(dot)com>

gdavis(at)refractions(dot)net (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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group