Update blocking a select count(*)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux