Default gin operator class of jsonb failing with index row size maximum reached

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Default gin operator class of jsonb failing with index row size maximum reached
Date: 2014-04-08 03:29:03
Message-ID: CAB7nPqT8OYHCPKU4nMYdqa_xZH1+8JFbtP=B+kjk6RZU5zGxGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

While doing some tests with jsonb, I found a failure as told in $subject:
=# create table data_jsonb (data jsonb);
CREATE TABLE
=# insert into data_jsonb ... tuple in the script attached
INSERT 1
=# create index data_index on data_jsonb using gin(data);
ERROR: 54000: index row size 1808 exceeds maximum 1352 for index "data_index"
LOCATION: GinFormTuple, ginentrypage.c:110
=# create index data_index2 on data_jsonb using gin (data jsonb_hash_ops);
CREATE INDEX

The data creating the failure is a tuple in a dump of geonames
(http://www.geonames.org/export/) listing some geographical data, and
it is caused by some arabic characters it seems used to provide
translations for a given geographical location. Encoding of the
database on which I have done the tests is UTF-8. Japanese, Chinese
equivalents were working fine btw with this operator.

Documentation of jsonb tells that jsonb documents should be kept at a
reasonable size to reduce lock contention, but there is no mention of
size limitation for indexes:
http://www.postgresql.org/docs/devel/static/datatype-json.html

A test case is attached, note as well that only the default gin
operator class is failing, jsonb_hash_ops worked well.
Regards,
--
Michael

Attachment Content-Type Size
jsonb_index_error.sql application/octet-stream 3.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-04-08 03:41:02 Re: WAL replay bugs
Previous Message Josh Berkus 2014-04-08 03:19:45 Re: WAL replay bugs