Re: SLEEP in posgresql

From: Richard Huxton <dev(at)archonet(dot)com>
To: Jasbinder Singh Bali <jsbali(at)gmail(dot)com>
Cc: Michal Taborsky - Internet Mall <michal(dot)taborsky(at)mall(dot)cz>, pgsql-general(at)postgresql(dot)org
Subject: Re: SLEEP in posgresql
Date: 2007-10-10 08:41:34
Message-ID: 470C903E.1090208@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jasbinder Singh Bali wrote:
> my loop is a busy wait and keeps iterating until a=b condition is met.
> However, it would lead to millions of instructions executing per second.
>
> So to save resources, I want to keep a sleep before re-iterating. Don't
> understand how is SLEEP disastrous here even if i don't know when is my loop
> going to end

What if it takes a week?

That means you'll have a transaction open for a week blocking vacuum
from reclaiming space.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Kelly 2007-10-10 08:44:00 Re: DB upgrade
Previous Message Jasbinder Singh Bali 2007-10-10 08:30:42 Re: SLEEP in posgresql