Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DA0D1476331 for ; Wed, 18 Sep 2002 17:58:58 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id AA2A74761D9 for ; Wed, 18 Sep 2002 17:58:54 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 96471D60D; Wed, 18 Sep 2002 14:58:56 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 8BED45C03; Wed, 18 Sep 2002 14:58:56 -0700 (PDT) Date: Wed, 18 Sep 2002 14:58:56 -0700 (PDT) From: Stephan Szabo To: Aaron Held Cc: pgsql-sql Subject: Re: Performance w/ multiple WHERE clauses In-Reply-To: <007401c25f58$da559dc0$6220010a@metrony.com> Message-ID: <20020918145825.X19535-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/208 X-Sequence-Number: 9485 On Wed, 18 Sep 2002, Aaron Held wrote: > I am running into a serious performance issue with some basic queries. > > If I run something like > > select * from "Calls" WHERE > ( ("CallType" = 'LONG DIST' )) > > The search takes about 15 seconds > > if I run > select * from "Calls" WHERE > ( ( "DateOfCall"='06/19/02') ) > AND ( ( "CallType" = 'LONG DIST' )) > [DateOfCall is a DateTime field] > > it takes 15 minutes! > > both columns are indexed individually and expalain reports and Index scan for both > queries. > > Any pointers where to look next? Are they using the same index? Have you done analyze recently?