From: Jeff Davis <pgsql@j-davis.com>
To: Rainer Mager <rainer@vanten.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: why does this use the wrong index?
Date: Fri, 19 Sep 2008 11:43:24 -0700
Message-ID: <1221849804.6194.297.camel@dell.linuxdev.us.dell.com> (raw)
In-Reply-To: <1221848728.6194.292.camel@dell.linuxdev.us.dell.com>
References: <000101c919ef$7c0b8e20$7422aa60$@com>
<1221848728.6194.292.camel@dell.linuxdev.us.dell.com>
On Fri, 2008-09-19 at 11:25 -0700, Jeff Davis wrote:
> What's the n_distinct for start_time?
Actually, I take that back. Apparently, PostgreSQL can't change "x
BETWEEN y AND y" into "x=y", so PostgreSQL can't use n_distinct at all.
That's your problem. If it's one day only, change it to equality and it
should be fine.
Regards,
Jeff Davis
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: pgsql@j-davis.com, rainer@vanten.com
Subject: Re: why does this use the wrong index?
In-Reply-To: <1221849804.6194.297.camel@dell.linuxdev.us.dell.com>
* 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