From: Simon Riggs <simon@2ndquadrant.com>
To: Kris Kiger <kris@musicrebellion.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Concurrency
Date: Mon, 09 May 2005 19:58:43 +0100
Message-ID: <1115665123.3830.38.camel@localhost.localdomain> (raw)
In-Reply-To: <427F9C06.3070206@musicrebellion.com>
References: <671060015.20031010095617@roaddep.ru>
<427F9C06.3070206@musicrebellion.com>
On Mon, 2005-05-09 at 12:21 -0500, Kris Kiger wrote:
> Quick question. I lock a table, call it table X, and then issue two
> updates on that table. The two updates are left waiting. I then unlock
> the table. The two updates go through. My question is, is there a
> predictable way to determine which query will be executed first? Thanks
> in advance
The lock queue is served in FIFO sequence. It is predictable, but if you
don't know which order they were submitted in it might be hard to
determine what that predictable order is, if they were submitted almost
at the same time.
...but you shouldn't use locking as a queuing mechanism.
Best Regards, Simon Riggs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: simon@2ndquadrant.com, kris@musicrebellion.com
Subject: Re: Concurrency
In-Reply-To: <1115665123.3830.38.camel@localhost.localdomain>
References: <671060015.20031010095617@roaddep.ru> <427F9C06.3070206@musicrebellion.com> <1115665123.3830.38.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox