Re: Need some info on Postgresql

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Suresh Gupta VG" <suresh(dot)g(at)zensar(dot)com>
Cc: "Peter Koczan" <pjkoczan(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Need some info on Postgresql
Date: 2008-01-08 15:25:07
Message-ID: dcc563d10801080725o6edf5f46r67173239fe1d8d02@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Jan 8, 2008 1:39 AM, Suresh Gupta VG <suresh(dot)g(at)zensar(dot)com> wrote:
>
> Thanks Scott for your reply.
>
> Actually, our application will extract all the data from currency table and
> never uses that table later at all. I don't know which process is locking
> that table. Pls find the attached file for the list of locks available on
> our Pgsql. Our database is restarted recently last 2 days back. No fruitful
> result has come.

Then whatever is causing your problems is happening right after you
turn it back on.

> Pls advice us why it is happening. And our database is taking more than 5
> minutes to execute a simple query directly on the database at the peak
> timings say (9:00 Am to 11:00 AM).

It's your database it's happening in, so the why is hidden away in
there. All I can do is help you find it, as I'm not looking at it
myself... :)

> Pls advice and suggest us what to do.

Try this query:

select pgc.relname, pgl2.relation, pgl.mode from pg_locks pgl join
pg_locks pgl2
on (pgl.relation is null AND pgl2.relation is not null and
pgl.pid=pgl2.pid) join pg_class pgc on (pgl2.relation=pgc.oid);

and look for modes that are ExclusiveLock and the like. Shared stuff isn't bad.

So, I'm guessing that something you're doing with your database is
taking out these locks. DDL in a long running transaction, that kind
of thing.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Hans Guijt 2008-01-08 16:44:10 Less intrusive ways to cluster?
Previous Message Suresh Gupta VG 2008-01-08 07:39:36 Re: Need some info on Postgresql