From: chris smith <dmagick@gmail.com>
To: Gavin Hamill <gdh@laterooms.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow query - possible bug?
Date: Thu, 13 Apr 2006 22:46:06 +1000
Message-ID: <3c1395330604130546g6b091f75x511955817fe65dcd@mail.gmail.com> (raw)
In-Reply-To: <443E3DF5.4020207@laterooms.com>
References: <443E3DF5.4020207@laterooms.com>
On 4/13/06, Gavin Hamill <gdh@laterooms.com> wrote:
> laterooms=# explain analyze select allocation0_."ID" as y1_,
> allocation0_."RoomID" as y2_, allocation0_."StatusID" as y4_,
> allocation0_."Price" as y3_, allocation0_."Number" as y5_,
> allocation0_."Date" as y6_ from "Allocation" allocation0_ where
> (allocation0_."Date" between '2006-06-09 00:00:00.000000' and
> '2006-06-09 00:00:00.000000')and(allocation0_."RoomID" in(4300591));
> QUERY PLAN
> ------------------------------------------------------------------------------------------------------------------------------------------
> Index Scan using ix_date on "Allocation" allocation0_ (cost=0.00..4.77
> rows=1 width=34) (actual time=1411.325..1689.860 rows=1 loops=1)
> Index Cond: (("Date" >= '2006-06-09'::date) AND ("Date" <=
> '2006-06-09'::date))
> Filter: ("RoomID" = 4300591)
> Total runtime: 1689.917 ms
> (4 rows)
1.6secs isn't too bad on 4.3mill rows...
How many entries are there for that date range?
--
Postgresql & php tutorials
http://www.designmagick.com/
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: dmagick@gmail.com, gdh@laterooms.com
Subject: Re: Slow query - possible bug?
In-Reply-To: <3c1395330604130546g6b091f75x511955817fe65dcd@mail.gmail.com>
References: <443E3DF5.4020207@laterooms.com> <3c1395330604130546g6b091f75x511955817fe65dcd@mail.gmail.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