Re: Slow query - possible bug?

From: Gavin Hamill <gdh(at)laterooms(dot)com>
To:
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query - possible bug?
Date: 2006-04-13 13:05:33
Message-ID: 443E4C9D.3090301@laterooms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

chris smith wrote:

>1.6secs isn't too bad on 4.3mill rows...
>
>How many entries are there for that date range?
>
>
1.7 secs /is/ good - it typically takes 5 or 6 seconds, which isn't so
good. My question is 'why does the planner choose such a bizarre range
request when both elements of the 'between' are identical? :)'

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 :) - and
yup I've been using different dates for each test to avoid the query
being cached.

For ref, there are typically 35000 rows per date :)

Cheers,
Gavin.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2006-04-13 13:59:36 Re: Slow query - possible bug?
Previous Message chris smith 2006-04-13 12:46:06 Re: Slow query - possible bug?