Re: Proposal: String key space for advisory locks
От | Heikki Linnakangas |
---|---|
Тема | Re: Proposal: String key space for advisory locks |
Дата | |
Msg-id | 4AE5B38B.2000705@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: Proposal: String key space for advisory locks (Alvaro Herrera <alvherre@commandprompt.com>) |
Список | pgsql-hackers |
Alvaro Herrera wrote: > Christophe Pettus wrote: > >> API Changes: >> >> Overloading the various advisory lock functions to take a suitable >> string type (varchar(64)?) in addition to the bigint / 2 x int >> variations. As with the bigint / 2 x int forms, this string >> namespace would be disjoint from the other key spaces. > > I don't think this can be made to work. The locktag hash element has a > fixed size. Perhaps you could make it work if you hashed the string and > used that as a locktag, but it would lock too much as soon as two > strings had matching hashes. You could add another level of indirection, e.g by adding a new table that maps the string to a bigint. I doubt it's worth the effort and performance impact, though. Cleaning up old unused rows from the table etc. would require a fair amount of work. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: