Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BF20A476DD7 for ; Fri, 20 Sep 2002 10:10:48 -0400 (EDT) Received: from metrony.com (webware.metrony.com [207.159.131.106]) by postgresql.org (Postfix) with ESMTP id E3DD5476D6D for ; Fri, 20 Sep 2002 10:10:47 -0400 (EDT) Received: from MetroNY.com ([66.9.109.130]) by metrony.com (8.11.0/8.11.0) with ESMTP id g8KE9KT33219; Fri, 20 Sep 2002 14:09:20 GMT (envelope-from aaron@MetroNY.com) Message-ID: <3D8B2C02.8020904@MetroNY.com> Date: Fri, 20 Sep 2002 10:09:06 -0400 From: Aaron Held User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chris Ruprecht , pgsql-sql@postgresql.org Subject: Re: Performance w/ multiple WHERE clauses References: <5.1.1.6.2.20020918111926.00a82058@mail.nashlinux.com> <007401c25f58$da559dc0$6220010a@metrony.com> <200209182039.59437.chrup@earthlink.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/241 X-Sequence-Number: 9518 Thanks, Changing '0/19/01' to '0/19/01'::date gave me a subjective 50% speedup. A ran a bunch of queries w/ explain and I noticed that some combinations did not use the indexes and went right to seq scan. All of the where clause args are indexed. # SET enable_seqscan to FALSE ; forced the use of an Index and sped things up greatly. I am not sure why it made the switch. The load on the server seems to affect the performance, but I am seeing it more on the production server with 100 million rows as opposed to the development server with only about 6 million. I need to buy more drives and develop on a larger data set. Thanks for the help, -Aaron Held Chris Ruprecht wrote: > Aaron, > > On Wed September 18 2002 17:17, 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] > > > try ... "DateOfCall" = '2002-06-19'::date ... > > Best regards, > Chris