Re: index row size 2720 exceeds btree version 4

Поиск
Список
Период
Сортировка
От Albrecht Dreß
Тема Re: index row size 2720 exceeds btree version 4
Дата
Msg-id G3ESHIGY.BFEFVCBJ.VO5LRTHQ@FA4CB54F.DUG4SYDN.RWGAN2WF
обсуждение исходный текст
Ответ на index row size 2720 exceeds btree version 4  (Daulat <daulat.dba@gmail.com>)
Список pgsql-general
Am 10.08.22 06:57 schrieb(en) Daulat:
> We are facing an error while uploading data in a table that has two B-tree
> indexes. As per the Postgres documentation there is a limitation of b-tree
> index size but I need to know if there is any alternative to overcome this
> issue.
[snip]
> UNIQUE INDEX uk_gvoa_gi_ad ON test.groupedvuln_asset USING btree (group_id,
> hostip, macaddress, fqdn, scanid)"

I had a similar issue, which I solved by creating an index on the hash of the concatenation of the items, i.e.
somethinglike 

CREATE UNIQUE INDEX uk_gvoa_gi_ad ON test.groupedvuln_asset
     USING btree (sha256(group_id::bytea || hostip::bytea || macaddress::bytea || fqdn::bytea || scanid::bytea));

Not guaranteed to be 100% collision free, though, but should be sufficient for most real-world use cases.

Hth,
Albrecht.

Вложения

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

Предыдущее
От: ml@ft-c.de
Дата:
Сообщение: pkg: two postgresql clients
Следующее
От: Peter
Дата:
Сообщение: Re: pkg: two postgresql clients