slow query - Mailing list pgsql-novice

From Ludwig Lim
Subject slow query
Date
Msg-id 20020409091828.46632.qmail@web20406.mail.yahoo.com
Whole thread Raw
Responses Re: slow query
List pgsql-novice
Hi,

Just switched an application from Oracle to PostgreSQL
recently.  I am experiencing a strange problem:
whenever I execute a relatively heavy query
in PostgreSQL, it just hangs.  To isolate the problem,
I've tried executing the query directly from psql
instead of using the application itself and
have gotten the same results.  I've even tried
vacuuming all the tables.

Anyway, viewing the process list reveals a postmaster
process that takes up 99.9% of the CPU time and just
executes forever.  Each time I execute a relatively
heavy query, a new postmaster process get stuck.  The
queries aren't really complex, i.e. a sum on a 3 table
join (about 200,000 rows  for the biggest table) [The
tables are indexed].  Like I said, Oracle takes at
most, 40 seconds to process the same query with the
same data on the same machine (dual  PIII with 1GB
RAM).  Something must be wrong...

OS:      RH 6.2
DB:      PG 7.2
APP:     CGI (using pqlib)
KERNEL:  2.4.18 (just in case it makes a diff)



  The query seemed to worked faster when one of the
index is removed. Is there a side effect when a table
has more 2 indices?


thanks,
ludwig.



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

pgsql-novice by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: installation problem
Next
From: Ludwig Lim
Date:
Subject: Running stored procedure