X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 86AA411F662C for ; Thu, 13 Apr 2006 09:46:10 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.6 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5 tests=[BAYES_00=-2.599, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id JytaMaZbosCO for ; Thu, 13 Apr 2006 09:46:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.198]) by postgresql.org (Postfix) with ESMTP id 999C311F6626 for ; Thu, 13 Apr 2006 09:46:05 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id m7so1664742nzf for ; Thu, 13 Apr 2006 05:46:06 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bjMhtFf6SzQzwLBdLRDBo4AExUztJ90KnppQugPHM6fFVJMBMkXnXAI9OkJcjCfugwr55H4l4i9tw+m3hdGZlr2b8xB84Jt4Cy9BF2FCaEFL4ljA8CoCnGBvGwuN5s3G6T5M/zP5LDckjOKN80sEtvN+inmj6ofTqJMjmPlyxcQ= Received: by 10.36.126.3 with SMTP id y3mr226945nzc; Thu, 13 Apr 2006 05:46:06 -0700 (PDT) Received: by 10.36.97.14 with HTTP; Thu, 13 Apr 2006 05:46:06 -0700 (PDT) Message-ID: <3c1395330604130546g6b091f75x511955817fe65dcd@mail.gmail.com> Date: Thu, 13 Apr 2006 22:46:06 +1000 From: "chris smith" To: "Gavin Hamill" Subject: Re: Slow query - possible bug? Cc: pgsql-performance@postgresql.org In-Reply-To: <443E3DF5.4020207@laterooms.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <443E3DF5.4020207@laterooms.com> X-Archive-Number: 200604/296 X-Sequence-Number: 18380 On 4/13/06, Gavin Hamill wrote: > laterooms=3D# 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 PLA= N > -------------------------------------------------------------------------= ----------------------------------------------------------------- > Index Scan using ix_date on "Allocation" allocation0_ (cost=3D0.00..4.7= 7 > rows=3D1 width=3D34) (actual time=3D1411.325..1689.860 rows=3D1 loops=3D1= ) > Index Cond: (("Date" >=3D '2006-06-09'::date) AND ("Date" <=3D > '2006-06-09'::date)) > Filter: ("RoomID" =3D 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/