Re: GSoC 2018 Project Ideas & Mentors - Last Call

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: GSoC 2018 Project Ideas & Mentors - Last Call
Дата
Msg-id CAA4eK1KATC1TA5bR5eobYQVO3RWsnH6djNpk3P376em4V8MuUA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: GSoC 2018 Project Ideas & Mentors - Last Call  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Mon, Jan 22, 2018 at 7:17 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Sun, Jan 21, 2018 at 9:02 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> How about adding a project to support Unique capability for the Hash
>> Index?
>
> Hmm, that seems pretty hard.
>

Yeah, but I think here hard part is to decide the solution to achieve
it.   The problem is that for the hash index to ensure that there is
no duplicate entry we need to traverse the whole bucket chain and also
we need to ensure that only one backend should be allowed to perform
it.  The simplest way to ensure that is to take and retain an
exclusive lock on the primary bucket for the whole operation.  Now,
considering that for unique indexes there shouldn't be many overflows
buckets, retaining lock doesn't sound to be much problematic.  We can
even think of slightly different locking technique as well which is
that instead of always retaining the lock on the primary bucket, we
can keep the lock on the first bucket where we find the space to
insert the key and then proceed to find the entry again by taking an
exclusive lock on each overflow bucket one-by-one. Only one inserter
should win in this scheme, the others should find the entry inserted
by it and probably the concurrency won't also be bad.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] MERGE SQL Statement for PG11
Следующее
От: David Steele
Дата:
Сообщение: Re: PATCH: Configurable file mode mask