Search Postgresql Archives

max number of locks

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

 



Hi,


while experimenting with number of locks, i found something I cannot understand.

From what i can read in the documentation, at any one given time, a query can obtain a max number of locks given by

max_locks_per_transaction * (max_connections + max_prepared_transactions)

I then changed my db to use this settings:

mydb=# show max_locks_per_transaction ;
 max_locks_per_transaction
---------------------------
 20
(1 row)

mydb=# show max_connections ;
 max_connections
-----------------
 2
(1 row)

mydb=# show  max_prepared_transactions ;
 max_prepared_transactions
---------------------------
 0
(1 row)

so i expected to be able to acquire a maximum of 40 locks.


Then:


mydb=# begin transaction ;
BEGIN
portavita=# SELECT 1 FROM root.ac;
 ?column?
----------
(0 rows)

mydb=# select count(*) from pg_locks ;
 count
-------
   132
(1 row)


Why can I acquire 132 locks while the expected number is 40? What am I doing wrong?

I m running Postgres 9.2.6



Thanks for your time,



Fabio

 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux