Re: simple update query stuck

From: Si Chen <sichen(at)opensourcestrategies(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: simple update query stuck
Date: 2014-04-01 20:11:15
Message-ID: CAAYSSjNezzKdCdrWGJG=-j6AEFUryMRWGRx6==OCF52LY3_i4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for writing back, but I don't think so. There's no message of a
deadlock in the log, and the first query started at 12:25, the next one
12:31, 12:39, 12:50, 12:54, so there's plenty of time in between.

On Tue, Apr 1, 2014 at 1:01 PM, Hoover, Jeffrey <jhoover(at)jcvi(dot)org> wrote:

> Could they both be trying to update the same row, resulting in a deadlock?
>
>
>
> *From:* pgsql-general-owner(at)postgresql(dot)org [mailto:
> pgsql-general-owner(at)postgresql(dot)org] *On Behalf Of *Si Chen
> *Sent:* Tuesday, April 01, 2014 3:51 PM
> *To:* pgsql-general(at)postgresql(dot)org
> *Subject:* [GENERAL] simple update query stuck
>
>
>
> Hello,
>
>
>
> I'm using postgresql 9.0.13, and I have a simple query that seems to be
> stuck. I did a
>
> postgres=# select procpid, query_start, waiting, current_query from
> pg_stat_activity;
>
>
>
> procpid | query_start | waiting |
>
> current_query
>
>
>
>
> 32605 | 2014-04-01 12:39:46.957666-07 | t | UPDATE
> public.GL_ACCOUNT_ORGANIZATION SET ROLE_TYPE_ID=$1, FROM_DATE=$2,
> THRU_DATE=$3, POSTED_BALANCE=$4, LAST_UPDATED_STAMP=$5,
> LAST_UPDATED_TX_STAMP=$6, CREATED_STAMP=$7, CREATED_TX_STAMP=$8 WHERE
> GL_ACCOUNT
>
> _ID=$9 AND ORGANIZATION_PARTY_ID=$10
>
>
>
> 32685 | 2014-04-01 12:25:10.378481-07 | t | UPDATE
> public.GL_ACCOUNT_ORGANIZATION SET ROLE_TYPE_ID=$1, FROM_DATE=$2,
> THRU_DATE=$3, POSTED_BALANCE=$4, LAST_UPDATED_STAMP=$5,
> LAST_UPDATED_TX_STAMP=$6, CREATED_STAMP=$7, CREATED_TX_STAMP=$8 WHERE
> GL_ACCOUNT
>
> _ID=$9 AND ORGANIZATION_PARTY_ID=$10
>
>
>
> As you can see this is a pretty simple update query, but it's been running
> 24 minutes in one thread and nearly 10 minutes in the other thread. What's
> also strange is it's not trigger a transaction timeout either.
>
>
>
> I've already re-started the database recently, and there's not too many
> threads executing -- just 38 threads total. Is it possible that the table
> is corrupted or needs repair?
>
>
>
> --
> Si Chen
> Open Source Strategies, Inc.
> sichen(at)opensourcestrategies(dot)com
> http://www.OpenSourceStrategies.com
> LinkedIn: http://www.linkedin.com/in/opentaps
> Twitter: http://twitter.com/opentaps
>

--
Si Chen
Open Source Strategies, Inc.
sichen(at)opensourcestrategies(dot)com
http://www.OpenSourceStrategies.com
LinkedIn: http://www.linkedin.com/in/opentaps
Twitter: http://twitter.com/opentaps

Browse pgsql-general by date

  From Date Subject
Next Message Robert DiFalco 2014-04-01 20:21:17 SQL Question
Previous Message Igor Neyman 2014-04-01 20:10:03 Re: simple update query stuck