Re: why does this use the wrong index?

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Rainer Mager <rainer(at)vanten(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: why does this use the wrong index?
Date: 2008-09-19 18:43:24
Message-ID: 1221849804.6194.297.camel@dell.linuxdev.us.dell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2008-09-20 03:23:32 Re: Intel's X25-M SSD
Previous Message Jeff Davis 2008-09-19 18:25:28 Re: why does this use the wrong index?