Re: index row size exceeds btree maximum, 2713 - Solutions?

From: Dan Armbrust <daniel(dot)armbrust(dot)list(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: index row size exceeds btree maximum, 2713 - Solutions?
Date: 2005-07-18 20:17:35
Message-ID: 42DC0E5F.1080208@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
We have built a Model for terminologies that we call The Lexical Grid
(more info <a class="moz-txt-link-freetext" href="http://informatics.mayo.edu/LexGrid/index.php">http://informatics.mayo.edu/LexGrid/index.php</a>)<br>
<br>
LexGrid has multiple backend data storage mechanisms, including LDAP
and SQL.&nbsp; We do our best to remain implementation independent - our SQL
implementations, for example can run against MS Access, DB2, MySQL and
PostgreSQL.<br>
<br>
I'm currently trying to load a new terminology into a PosgreSQL
backend, and arrived at this error because it happens to have a couple
of very large data values that get mapped into the 'propertyvalue'
field.<br>
<br>
The structure of the table that I am (currently) having problems with
is: (apologies if your client does not parse HTML - this is what is
convenient to me right now)<br>
<br>
<table>
<tbody>
<tr>
<td class="data1">codingschemename</td>
<td class="data1">character varying(70)</td>
<td class="data1">
<div align="center">NOT NULL</div>
</td>
<td class="data1"><br>
</td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=codingschemename&amp;">Alter</a></td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=codingschemename&amp;">Drop</a></td>
<td class="data1"><br>
</td>
</tr>
<tr>
<td class="data2">conceptcode</td>
<td class="data2">character varying(100)</td>
<td class="data2">
<div align="center">NOT NULL</div>
</td>
<td class="data2"><br>
</td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=conceptcode&amp;">Alter</a></td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=conceptcode&amp;">Drop</a></td>
<td class="data2"><br>
</td>
</tr>
<tr>
<td class="data1">propertyid</td>
<td class="data1">character varying(50)</td>
<td class="data1">
<div align="center">NOT NULL</div>
</td>
<td class="data1"><br>
</td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=propertyid&amp;">Alter</a></td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=propertyid&amp;">Drop</a></td>
<td class="data1"><br>
</td>
</tr>
<tr>
<td class="data2">property</td>
<td class="data2">character varying(250)</td>
<td class="data2">
<div align="center">NOT NULL</div>
</td>
<td class="data2"><br>
</td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=property&amp;">Alter</a></td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=property&amp;">Drop</a></td>
<td class="data2"><br>
</td>
</tr>
<tr>
<td class="data1">language</td>
<td class="data1">character varying(32)</td>
<td class="data1"><br>
</td>
<td class="data1"><br>
</td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=language&amp;">Alter</a></td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=language&amp;">Drop</a></td>
<td class="data1"><br>
</td>
</tr>
<tr>
<td class="data2">presentationformat</td>
<td class="data2">character varying(50)</td>
<td class="data2"><br>
</td>
<td class="data2"><br>
</td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=presentationformat&amp;">Alter</a></td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=presentationformat&amp;">Drop</a></td>
<td class="data2"><br>
</td>
</tr>
<tr>
<td class="data1">datatype</td>
<td class="data1">character varying(50)</td>
<td class="data1"><br>
</td>
<td class="data1"><br>
</td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=datatype&amp;">Alter</a></td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=datatype&amp;">Drop</a></td>
<td class="data1"><br>
</td>
</tr>
<tr>
<td class="data2">ispreferred</td>
<td class="data2">boolean</td>
<td class="data2"><br>
</td>
<td class="data2"><br>
</td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=ispreferred&amp;">Alter</a></td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=ispreferred&amp;">Drop</a></td>
<td class="data2"><br>
</td>
</tr>
<tr>
<td class="data1">degreeoffidelity</td>
<td class="data1">character varying(50)</td>
<td class="data1"><br>
</td>
<td class="data1"><br>
</td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=degreeoffidelity&amp;">Alter</a></td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=degreeoffidelity&amp;">Drop</a></td>
<td class="data1"><br>
</td>
</tr>
<tr>
<td class="data2">matchifnocontext</td>
<td class="data2">boolean</td>
<td class="data2"><br>
</td>
<td class="data2"><br>
</td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=matchifnocontext&amp;">Alter</a></td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=matchifnocontext&amp;">Drop</a></td>
<td class="data2"><br>
</td>
</tr>
<tr>
<td class="data1">representationalform</td>
<td class="data1">character varying(50)</td>
<td class="data1"><br>
</td>
<td class="data1"><br>
</td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=representationalform&amp;">Alter</a></td>
<td class="opbutton1"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=representationalform&amp;">Drop</a></td>
<td class="data1"><br>
</td>
</tr>
<tr>
<td class="data2">propertyvalue</td>
<td class="data2">text</td>
<td class="data2">
<div align="center">NOT NULL</div>
</td>
<td class="data2"><br>
</td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=properties&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=propertyvalue&amp;">Alter</a></td>
<td class="opbutton2"><a
href="http://mir04.mayo.edu/pgadmin/tblproperties.php?action=confirm_drop&amp;database=LexGrid2&amp;schema=public&amp;table=conceptproperty&amp;column=propertyvalue&amp;">Drop</a></td>
<td class="data2"><br>
</td>
</tr>
</tbody>
</table>
<br>
The structure of the table is not easily changed, as it closely follows
our model.<br>
<br>
The index that is failing is CREATE INDEX i1 ON conceptproperty USING
btree (codingschemename, property, propertyvalue).<br>
<br>
Usually, the 'propertyValue' field is fairly short - 100 chars or
less.&nbsp; And in those cases, I need to be able to do an indexed search on
it.&nbsp; In this particular case, this terminology has a propertyValue that
is very long.&nbsp; I can't just toss it.&nbsp; I don't really care if it makes
it into the index - for a terminology with as much data as this has,
I'll be using Lucene to do text searches anyway - but I do need to be
able to return the full propertyValue in response to a propertyId query.<br>
<br>
I also don't want to negatively affect the performance of the rest of
the DB just to accommodate this instance - hence the questions about
the implications of changing the BLCKSZ variable.<br>
<br>
Dan<br>
<br>
<br>
<br>
Bruno Wolff III wrote:
<blockquote cite="mid20050718195433(dot)GA23508(at)wolff(dot)to" type="cite">
<pre wrap="">On Mon, Jul 18, 2005 at 14:44:26 -0500,
Dan Armbrust <a class="moz-txt-link-rfc2396E" href="mailto:daniel(dot)armbrust(dot)list(at)gmail(dot)com">&lt;daniel(dot)armbrust(dot)list(at)gmail(dot)com&gt;</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I'm trying to load some data into PostgreSQL 8.0.3, and I got the error
message "index row size 2904 exceeds btree maximum, 2713". After a
bunch of searching, I believe that I am getting this error because a
value that I am indexing is longer than ~ 1/3 of the block size - or the
BLCKSZ variable in the src/include/pg_config_manual.h file.

Am I correct so far?

I need to fix this problem. I cannot change the indexed columns. I
cannot shorten the data value. And I cannot MD5 it, or any of those
hashing types of solutions that I saw a lot while searching.
</pre>
</blockquote>
<pre wrap=""><!---->
Can you explain how you are using the index now and what you are trying
to accomplish? It is hard to suggest alternatives without knowing what
you are really trying to do.

</pre>
</blockquote>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 11.1 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Casanova 2005-07-18 20:27:51 Re: index row size exceeds btree maximum, 2713 - Solutions?
Previous Message Bruno Wolff III 2005-07-18 19:54:33 Re: index row size exceeds btree maximum, 2713 - Solutions?