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 09:24:45
Message-ID: 470C9A5D.5070607@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jasbinder Singh Bali wrote:
> I don't know how is a sleep of 1 second going to be harmful here instead of
> keeping a busy wait.
>
> Even if a=b is going to take 1 week as u say, isn't a sleep of 1 second, if
> nothing, would save some CPU resources instead of blindly looping for ever ?
> Aren't busy waits dangerous from CPU resources point of view ? Won't it keep
> my CPU busy for ever. Also, if there's a sleep of 1 second, is it going to
> give me some saving in CPU resources or not ?

It's not the sleep that people are saying is harmful. It's the waiting
in a loop in a transaction.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-10-10 09:28:05 Re: ORDER BY - problem with NULL values
Previous Message Dmitry Koterov 2007-10-10 09:24:33 Re: How to speedup intarray aggregate function?