pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Updates on one row causing ExclusiveLock on PostgreSQL 8.3.5
2+ messages / 1 participants
[nested] [flat]

* Updates on one row causing ExclusiveLock on PostgreSQL 8.3.5
@ 2013-01-10 18:01 PostgreSQL <postgresql@vorio.com.br>
  0 siblings, 0 replies; 2+ messages in thread

From: PostgreSQL @ 2013-01-10 18:01 UTC (permalink / raw)
  To: pgsql-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)

I can't understand what happens here...    This query can't be lock 
granted becouse another instance of this query already granted it.
I can't understand why an update that modify one row only need an 
ExclusiveLock.

Thanks a lot!!



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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Updates on one row causing ExclusiveLock on PostgreSQL 8.3.5
@ 2013-01-10 18:04 PostgreSQL <postgresql@vorio.com.br>
  0 siblings, 0 replies; 2+ messages in thread

From: PostgreSQL @ 2013-01-10 18:04 UTC (permalink / raw)
  To: pgsql-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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-01-10 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-01-10 18:01 Updates on one row causing ExclusiveLock on PostgreSQL 8.3.5 PostgreSQL <postgresql@vorio.com.br>
2013-01-10 18:04 Updates on one row causing ExclusiveLock on PostgreSQL 8.3.5 PostgreSQL <postgresql@vorio.com.br>

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