pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gavin Hamill <gdh@laterooms.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow query - possible bug?
Date: Thu, 13 Apr 2006 14:05:33 +0100
Message-ID: <443E4C9D.3090301@laterooms.com> (raw)
In-Reply-To: <3c1395330604130546g6b091f75x511955817fe65dcd@mail.gmail.com>
References: <443E3DF5.4020207@laterooms.com>
	<3c1395330604130546g6b091f75x511955817fe65dcd@mail.gmail.com>

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.




view thread (10+ messages)  latest in thread

Message-ID: <443E4C9D.3090301@laterooms.com>
Permalink:  ../443E4C9D.3090301@laterooms.com/
Also on:    postgresql.org/message-id/443E4C9D.3090301@laterooms.com

 · 

reply

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: gdh@laterooms.com
  Subject: Re: Slow query - possible bug?
  In-Reply-To: <443E4C9D.3090301@laterooms.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