Re: Performance w/ multiple WHERE clauses

From: Aaron Held <aaron(at)MetroNY(dot)com>
To: Chris Ruprecht <chrup(at)earthlink(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Performance w/ multiple WHERE clauses
Date: 2002-09-20 14:09:06
Message-ID: 3D8B2C02.8020904@MetroNY.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2002-09-20 14:38:25 Re: timestamp parse error
Previous Message alexandre :: aldeia digital 2002-09-20 13:39:09 Re: Query Freeze