Re: Slow query - possible bug?

From: "chris smith" <dmagick(at)gmail(dot)com>
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 12:46:06
Message-ID: 3c1395330604130546g6b091f75x511955817fe65dcd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 4/13/06, Gavin Hamill <gdh(at)laterooms(dot)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/

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Gavin Hamill 2006-04-13 13:05:33 Re: Slow query - possible bug?
Previous Message Gavin Hamill 2006-04-13 12:03:01 Slow query - possible bug?