pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Jozsef Szalay <jszalay@storediq.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Simple select hangs while CPU close to 100%
Date: Sun, 22 Jul 2007 17:52:34 +0200
Message-ID: <162867790707220852q2369eb3fi2c268925d1bd198@mail.gmail.com> (raw)
In-Reply-To: <E387E2E9622FDD408359F98BF183879EE02634@dc1.storediq.com>
References: <E387E2E9622FDD408359F98BF183879EE02634@dc1.storediq.com>

Hello

did you vacuum?

It's good technique do vacuum table after remove bigger number of rows.

Regards
Pavel Stehule

2007/7/22, Jozsef Szalay <jszalay@storediq.com>:
>
>
>
>
> I'm having this very disturbing problem. I got a table with about 100,000
> rows in it. Our software deletes the majority of these rows and then bulk
> loads another 100,000 rows into the same table. All this is happening within
> a single transaction. I then perform a simple "select count(*) from …"
> statement that never returns. In the mean time, the backend Postgres process
> is taking close to 100% of the CPU. The hang-up does not always happen on
> the same statement but eventually it happens 2 out of 3 times. If I dump and
> then restore the schema where this table resides the problem is gone until
> the next time we run through the whole process of deleting, loading and
> querying the table.
>
>
>
> There is no other activity in the database. All requested locks are granted.
>
>
>
> Has anyone seen similar behavior?
>
>
>
> Some details:
>
>
>
> Postgres v 8.1.2
>
> Linux Fedora 3
>
>
>
> shared_buffers = 65536
>
> temp_buffers = 32768
>
> work_mem = 131072
>
> maintenance_work_mem = 131072
>
> max_stack_depth = 8192
>
> max_fsm_pages = 40000
>
> wal_buffers = 16
>
> checkpoint_segments = 16
>
>
>
>
>
> top reports
>
>
>
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
>
> 19478 postgres  25   0  740m 721m 536m R 99.7  4.4 609:41.16 postmaster
>
>
>
> ps –ef | grep postgres reports
>
>
>
> postgres 19478  8061 99 00:11 ?        10:13:03 postgres: user dbase [local]
> SELECT
>
>
>
> strace –p 19478
>
> no system calls reported
>
>
>
>
>
> Thanks for the help!
>
> Jozsef



view thread (13+ messages)  latest in thread

Message-ID: <162867790707220852q2369eb3fi2c268925d1bd198@mail.gmail.com>
Permalink:  ../162867790707220852q2369eb3fi2c268925d1bd198@mail.gmail.com/
Also on:    postgresql.org/message-id/162867790707220852q2369eb3fi2c268925d1bd198@mail.gmail.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: pavel.stehule@gmail.com, jszalay@storediq.com
  Subject: Re: Simple select hangs while CPU close to 100%
  In-Reply-To: <162867790707220852q2369eb3fi2c268925d1bd198@mail.gmail.com>
  References: <E387E2E9622FDD408359F98BF183879EE02634@dc1.storediq.com> <162867790707220852q2369eb3fi2c268925d1bd198@mail.gmail.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