pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PostgreSQL <postgresql@vorio.com.br>
To: pgsql-performance@postgresql.org
Subject: Updates on one row causing ExclusiveLock on PostgreSQL 8.3.5
Date: Thu, 10 Jan 2013 16:04:02 -0200
Message-ID: <50EF0292.4000605@vorio.com.br> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

My best regards for all...

Please.  I need for an advice.
I'm having a trouble, that puting others queries in wait state, becouse 
of ExclusiveLock granted by an Update that only update one row at each 
time.   This update occurs into a function and this function are 
executed several times and concurrently.
Below, query plan (explain):

Nested Loop  (cost=16.91..36.32 rows=1 width=75)
   ->  HashAggregate  (cost=16.91..16.92 rows=1 width=4)
         ->  Index Scan using unq_customer_idx_msisdn on customer 
(cost=0.00..16.90 rows=1 width=4)
               Index Cond: ((msisdn)::text = '558796013980'::text)
   ->  Index Scan using pk_customer_rel_channel on customer_rel_channel  
(cost=0.00..19.39 rows=1 width=75)
         Index Cond: ((customer_rel_channel.id_customer = 
customer.id_customer) AND (customer_rel_channel.id_channel = 282))

But, the pg_locs shows:

PID    Relation    User    Transaction    Access Mode    Granted Query 
Start    Query
22569    customer_rel_channel    postgres        ExclusiveLock False    
2013-01-10 15:54:09.308056-02    UPDATE news.customer_rel_channel SET 
status = $1, source = $2
             WHERE news.customer_rel_channel.id_channel = $3 AND
             news.customer_rel_channel.id_customer IN
             (SELECT id_customer FROM public.customer WHERE 
public.customer.msisdn = $4)


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (2+ messages)

Message-ID: <50EF0292.4000605@vorio.com.br>
Permalink:  ../50EF0292.4000605@vorio.com.br/
Also on:    postgresql.org/message-id/50EF0292.4000605@vorio.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: postgresql@vorio.com.br
  Subject: Re: Updates on one row causing ExclusiveLock on PostgreSQL 8.3.5
  In-Reply-To: <50EF0292.4000605@vorio.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox