Re: allow LIMIT in UPDATE and DELETE

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Shelby Cain <alyandon(at)yahoo(dot)com>
Cc: Csaba Nagy <nagy(at)ecircle-ag(dot)com>, SCassidy(at)overlandstorage(dot)com, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>, pgsql-general-owner(at)postgresql(dot)org
Subject: Re: allow LIMIT in UPDATE and DELETE
Date: 2006-05-23 22:19:58
Message-ID: 20060523221958.GG64371@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, May 22, 2006 at 03:49:01PM -0700, Shelby Cain wrote:
> My experience with job queues comes from clients that mostly use Oracle as the backend. However, even with Oracle a queue table should be storing information about a job and not have records unnecessarily locked simply because they are being "worked on" by another hypothetical "job runner" process... by this I mean that the status of a job should be updated to a distinct state at any given moment in time (eg: unprocessed, processing, processed). In the case I present above, if you are using Postgresql you wouldnt have any open long-running transactions on that table and vacuuming should work... or am I misunderstanding the issue?

The issue is that vacuum has to base it's decisions not on the oldest
running transaction that has locks on a table, but on the oldest running
transaction in the entire database, because that transaction could start
reading any table at any time. Until that changes, long-running
transactions of any kind and heavy-update tables simply won't mix well
at all in a single database.

I recently proposed a way around this [1], but it didn't get much
traction.

[1] http://archives.postgresql.org/pgsql-general/2006-05/msg00184.php
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Florian G. Pflug 2006-05-23 22:20:06 Re: background triggers?
Previous Message Tom Lane 2006-05-23 22:18:07 Re: Why won't it index scan?