Re: query locks up when run concurrently - Mailing list pgsql-general

From Adrian Klaver
Subject Re: query locks up when run concurrently
Date
Msg-id 55767b92-fa40-8cee-7edf-96a4a91e8a42@aklaver.com
Whole thread Raw
In response to Re: query locks up when run concurrently  (azhwkd <azhwkd@gmail.com>)
Responses Re: query locks up when run concurrently  (azhwkd <azhwkd@gmail.com>)
List pgsql-general
On 11/23/2016 01:52 PM, azhwkd wrote:
> Greetings!
>
> The parallel calls should not be working on the same row. Each query
> services a different group ID on it's own and there is no overlap.

Except the INSERT query in the trigger function is working on dates not
group ids.

>
> Kind regards,
> Sebastian
>
>
> Tom Lane <tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us>> schrieb am Mi.,
> 23. Nov. 2016 um 17:47 Uhr:
>
>     azhwkd@gmail.com <mailto:azhwkd@gmail.com> writes:
>     > I have a query which if run alone usually completes in about 300ms.
>     > When run in my application this query constantly locks up and bogs
>     > down all connections of the connection pool (In the application this
>     > query is run up to 10 times in parallel with different parameters).
>     > What's really weird is that I can re-run one of the hung queries from
>     > the command line while it's hung and it will complete as expected
>     > while the hung queries continue to use 100% CPU time.
>
>     Judging from the EXPLAIN timing, most of the work is in the trigger,
>     which leads me to wonder if the parallel calls are likely to be fighting
>     over inserting/updating the same row in the group_history partition
>     tables.  Or are you certain that they should be hitting different rows?
>
>                             regards, tom lane
>


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: query locks up when run concurrently
Next
From: azhwkd
Date:
Subject: Re: query locks up when run concurrently