On Jan 8, 2008 1:39 AM, Suresh Gupta VG <suresh.g@zensar.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.