From: Scott Marlowe <smarlowe@qwest.net>
To: Greg Stark <gsstark@mit.edu>
Cc: Jack Kerkhof <jack.kerkhof@guest-tek.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why does a simple query not use an obvious index?
Date: Sun, 29 Aug 2004 15:44:15 -0600
Message-ID: <1093815855.5493.33.camel@localhost.localdomain> (raw)
In-Reply-To: <1093815480.5493.29.camel@localhost.localdomain>
References: <ENEIKKAEJOFHOIHMMOIDIEBMJCAA.jack.kerkhof@guest-tek.com>
<1093804128.5493.22.camel@localhost.localdomain>
<87fz65k5sq.fsf@stark.xeocode.com>
<1093815480.5493.29.camel@localhost.localdomain>
On Sun, 2004-08-29 at 15:38, Scott Marlowe wrote:
> On Sun, 2004-08-29 at 15:12, Greg Stark wrote:
> > "Scott Marlowe" <smarlowe@qwest.net> writes:
> >
> > > Also, count(*) is likely to always generate a seq scan due to the way
> > > aggregates are implemented currently in pgsql. you might want to try:
> >
> > Huh? I'm curious to know what you're talking about here.
>
> This has been discussed ad infinitum on the lists in the past. And
> explained by better minds than mine, but I'll give it a go.
>
> PostgreSQL has a "generic" aggregate method. Imagine instead doing a
> select count(id1+id2-id3) from table where ...
that should be avg(id1+id2-id3)... doh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: smarlowe@qwest.net, gsstark@mit.edu, jack.kerkhof@guest-tek.com
Subject: Re: Why does a simple query not use an obvious index?
In-Reply-To: <1093815855.5493.33.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox