Re: Update taking forever - Mailing list pgsql-novice

From Bianca Stephani
Subject Re: Update taking forever
Date
Msg-id CAL5He_dvuhvDRLQbc-9vDySRc6adhPPR0nkzMbGzkJNvNhcXQw@mail.gmail.com
Whole thread Raw
In response to Re: Update taking forever  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Update taking forever
Re: Update taking forever
List pgsql-novice


On Mon, Jun 15, 2015 at 9:17 AM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Monday, June 15, 2015, Bianca Stephani <bianca.stephani@gmail.com> wrote:
Hi everyone.
I want to update the value of a column of 25 thousand rows and a sql update is taking forever (literally, more then one day). There's any other way so i can do that?

This would normally takes seconds (at most) if everything is working properly, so yes.  I would suspect your where clause is not using an index to find those rows and there are a lot more than 25k rows on the table in question.  Show us schemas and explain output if you want a more definitive answer.

Ops, i must have looked on the wrong place. There are 420k rows. 
My update have no "where" clause because i want to update all rows. I'm adding two columns to the table and i'm setting one of them with a select count and the other with the result of a recursive sql (defined before the update, not at each row).



Or you have locking issue...

David J. 



--
Bianca Stephani.

"Killing time before time kill us"
"Panic called you out and took you in, giving you an easy game and letting you win"
"Who's gonna love you when you reach the end?"
"A diferença entre a vida e a arte é que a arte é mais suportável"
"Smile like you mean it"
"I told you I was brave, but I've lied"
"If you don't do anything, nothing can happen"

pgsql-novice by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Update taking forever
Next
From: "David G. Johnston"
Date:
Subject: Re: Update taking forever