Update blocking a select count(*)? - Mailing list pgsql-performance

From Benedict Holland
Subject Update blocking a select count(*)?
Date
Msg-id CAD+mzoxfm8Wa5hrekeakG_TYNd_dsTR3W3DPZEV90chuzh0N_A@mail.gmail.com
Whole thread Raw
Responses Re: Update blocking a select count(*)?  (Peter Geoghegan <peter@2ndquadrant.com>)
Re: Update blocking a select count(*)?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-performance
Hi all,

I am using postgresql 9.0 and I am updating a large table and running a select count(*). The update is run first and then the select. The update is blocking the select statement. To use the term MVCC (as seems to be done so much in this list), well it seems to be broken. MVCC should allow a select on the same table as an update, in fact nothing at all should block a select. Also for some reason, the update query seems to always get an Exclusive Lock which doesn't make any sense to me. At most an update should require a row lock. This seems to also apply to two updates on the same table in parallel.

Do I seem to have this right and is there anything I can do?

Thanks,
~Ben

pgsql-performance by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Expected performance of querying 5k records from 4 million records?
Next
From: Peter Geoghegan
Date:
Subject: Re: Update blocking a select count(*)?