Re: Patch: fix lock contention for HASHHDR.mutex

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: fix lock contention for HASHHDR.mutex
Date: 2015-12-18 13:46:41
Message-ID: 56740E41.4010708@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Oh, that's an interesting idea. I guess the problem is that if the
> freelist is unshared, then users might get an error that the lock
> table is full when some other partition still has elements remaining.

Could we split one freelist in hash to NUM_LOCK_PARTITIONS freelists?
Each partition will have its own freelist and if freelist is empty then
partition should search an entry in freelists of other partitions. To prevent
concurrent access it's needed to add one LWLock to hash, each partition should
lock LWlock in share mode to work with its own freelist and exclusive to work
with other freelists.

Actually, I'd like to improve all partitioned hashes instead of improve only one
case.

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-12-18 13:54:09 Re: Function and view to retrieve WAL receiver status
Previous Message Alexander Korotkov 2015-12-18 13:33:45 Re: statistics for array types