From: Aaron Held <aaron@MetroNY.com>
To: Chris Ruprecht <chrup@earthlink.net>
To: pgsql-sql@postgresql.org
Subject: Re: Performance w/ multiple WHERE clauses
Date: Fri, 20 Sep 2002 10:09:06 -0400
Message-ID: <3D8B2C02.8020904@MetroNY.com> (raw)
References: <5.1.1.6.2.20020918111926.00a82058@mail.nashlinux.com>
<007401c25f58$da559dc0$6220010a@metrony.com>
<200209182039.59437.chrup@earthlink.net>
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
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: aaron@MetroNY.com, chrup@earthlink.net
Subject: Re: Performance w/ multiple WHERE clauses
In-Reply-To: <3D8B2C02.8020904@MetroNY.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