Re: Help..Help... - Mailing list pgsql-general

From Csaba Nagy
Subject Re: Help..Help...
Date
Msg-id 96D568DD7FAAAD428581F8B3BFD9B0F604DE60@goldmine.ecircle.de
Whole thread Raw
In response to Help..Help...  (Murali Mohan Kasetty <kasetty@india.hp.com>)
List 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@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]Im Auftrag von Murali Mohan
Kasetty
Gesendet: Mittwoch, 13. November 2002 14:44
An: pgsql-general@postgresql.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



pgsql-general by date:

Previous
From: "Shridhar Daithankar"
Date:
Subject: Re: error: lost syncronization with server
Next
From: Tom Lane
Date:
Subject: Re: Upgrade to dual processor machine?