slow query

From: Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com>
To: PostgreSQL Mailing List <pgsql-novice(at)postgresql(dot)org>
Subject: slow query
Date: 2002-04-09 09:18:28
Message-ID: 20020409091828.46632.qmail@web20406.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ludwig Lim 2002-04-09 09:28:47 Running stored procedure
Previous Message Pierre-Alexis Paquin 2002-04-09 07:22:10 Problem in postgresql installation