Re: Concurrency question

From: "David Welton" <davidnwelton(at)gmail(dot)com>
To: "Postgres general mailing list" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Concurrency question
Date: 2006-03-28 14:15:50
Message-ID: 9877cd600603280615h754c8b4ay45ff82d55916b609@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

[ Oops, I missed the reply-to button the first time - sorry for the
repeat, Csaba ]

On 3/28/06, Csaba Nagy <nagy(at)ecircle-ag(dot)com> wrote:
> > Try breaking down the A query with LIMIT/OFFSET so that it never holds
> > locks for long. That way B will not wait for long, if at all, and will
> > not fail.
>
> Just as a remark, this will only work if the chunks can be processed in
> separate transactions. If the whole thing is related and A must be
> completely wrapped in a transaction, then the locks placed by the first
> queries will still hold until the end of the transaction...

The current system we have is plain broken, as it has no transactions
for anything, and we are getting bad results, occasionally. I'm not
sure if it's possible to split A (the long running, non-interactive
part) into multiple pieces. It starts first (if not, then there is no
problem), and if a user comes along and does B, that needs to stomp on
whatever A happened to be doing. It would probably be best if A just
failed and rolled back at that point (it'll get run again in a few
minutes, in any case).

I looked at the concurrency bits of the manual on line, but I was
getting the impression that B is the one that would potentially have
problems if it tried to write while A was doing its business (reading
and writing).

Thankyou,
--
David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Holger Hoffstaette 2006-03-28 14:33:46 Re: PostgreSQL's XML support comparison against other RDBMSes
Previous Message Geoffrey 2006-03-28 14:12:01 Re: FAQ 1.1