Re: Slow query - possible bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Hamill <gdh(at)laterooms(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query - possible bug?
Date: 2006-04-13 15:26:50
Message-ID: 20329.1144942010@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Gavin Hamill <gdh(at)laterooms(dot)com> writes:
> If I replace the
> (allocation0_."Date" between '2006-06-09 00:00:00.000000' and
> '2006-06-09 00:00:00.000000')
> with
> allocation0_."Date" ='2006-04-09 00:00:00.000000'
> then the query comes back in a few milliseconds (as I'd expect :)

Could we see EXPLAIN ANALYZE for
* both forms of the date condition, with the roomid condition;
* both forms of the date condition, WITHOUT the roomid condition;
* just the roomid condition

I'm thinking the planner is misestimating something, but it's hard
to tell what without breaking it down.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Oscar Picasso 2006-04-13 15:40:06 Re: Better index stategy for many fields with few values
Previous Message Cristian Veronesi 2006-04-13 14:57:57 index is not used if I include a function that returns current time in my query