Re: Help..Help...

Поиск
Список
Период
Сортировка
От Savita
Тема Re: Help..Help...
Дата
Msg-id 3DD36CFD.227F1FF@india.hp.com
обсуждение исходный текст
Ответ на Re: Help..Help...  (Csaba Nagy <nagy@domeus.de>)
Список pgsql-general
Hi Csaba,

We do have a foreign key defined on that table.SO what is the solution to
this??
Is there any setting required to avoid this locking problem.

Please help us to slove this problem.

Csaba Nagy wrote:

> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

--
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------



В списке pgsql-general по дате отправления:

Предыдущее
От: "Henrik Steffen"
Дата:
Сообщение: Re: Upgrade to dual processor machine?
Следующее
От: "Henrik Steffen"
Дата:
Сообщение: Re: Upgrade to dual processor machine?