Re: SLEEP in posgresql - Mailing list pgsql-general

From Richard Huxton
Subject Re: SLEEP in posgresql
Date
Msg-id 470C903E.1090208@archonet.com
Whole thread Raw
In response to Re: SLEEP in posgresql  ("Jasbinder Singh Bali" <jsbali@gmail.com>)
Responses Re: SLEEP in posgresql
Re: SLEEP in posgresql
List 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

pgsql-general by date:

Previous
From: "Jasbinder Singh Bali"
Date:
Subject: Re: SLEEP in posgresql
Next
From: "Albe Laurenz"
Date:
Subject: Re: replacing single quotes