Re: Help..Help...

From: Csaba Nagy <nagy(at)domeus(dot)de>
To: "'Murali Mohan Kasetty'" <kasetty(at)india(dot)hp(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help..Help...
Date: 2002-11-13 14:04:41
Message-ID: 96D568DD7FAAAD428581F8B3BFD9B0F604DE60@goldmine.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

This could be caused by the foreign key locking mechanism used by postgres.
Do you have foreign keys defined on that table ? Do the new inserted rows
point to the same row in the referenced table ? If yes, that's the cause.
You can insert only from 1 process at a time, because the referenced row is
locked exclusively, and therefore all other processes trying to insert in
the same table a row referencing the same foreign key will have to wait
untill the first transaction finishes. Ditto for updates which change rows
referencing the same foreign key.
Postgres foreign keys are also deadlock prone because of this locking
mechanism.
Hopefully this will be improved soon (there is some work done toward this).

Cheers,
Csaba.

-----Ursprungliche Nachricht-----
Von: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org]Im Auftrag von Murali Mohan
Kasetty
Gesendet: Mittwoch, 13. November 2002 14:44
An: pgsql-general(at)postgresql(dot)org
Betreff: [GENERAL] Help..Help...

Hi All,

We are using PostgreSQL 7.2.

We are running two processes accessing the same table using JDBC. Both
the
processes updates records in the same table. The same rows will not be
updated by the processes at the same time.

When the processes are run concurrently, the time taken is X seconds
each.
But, when we run the same processes together, we are seeing that the
time
taken is worse than 2X.

Is it possible that there is a contention that is occuring while the
records
are being written. Has anybody experienced a similar problem. What is
the
LOCK mechanism that is used by PostgreSQL.

Any help would be greatly appreciated.

Thanks in advance,
Murali

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-11-13 14:11:03 Re: Upgrade to dual processor machine?
Previous Message Shridhar Daithankar 2002-11-13 14:02:14 Re: error: lost syncronization with server