Thread: BTree max row size?

BTree max row size?

From
Ernest Kim
Date:
Hi all.  I'm getting the following error message when I try to update
a row in a table:

ERROR:  54000: index row size 2720 exceeds btree maximum, 2713

Does anyone know how to to change the btree maximum row size?  How did
it come up with 2713 as a max row size?

Thanks.

-Ernie

Re: BTree max row size?

From
Alvaro Herrera
Date:
On Thu, Dec 16, 2004 at 06:20:57PM -0500, Ernest Kim wrote:

Hi,

> I'm getting the following error message when I try to update a row in
> a table:
>
> ERROR:  54000: index row size 2720 exceeds btree maximum, 2713
>
> Does anyone know how to to change the btree maximum row size?  How did
> it come up with 2713 as a max row size?

You could compile Postgres with BLCKSZ set to a higher value (currently
8192).  Or you could change your indexing strategy, because if you now
want to store 2720 bytes, some other day you may want to store 11000,
and then you would overflow the ~10900 bytes that a 32768 BLCKSZ would
buy you.

What are you indexing?

The 2713 comes from (8192 - some overhead) / 3.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Las cosas son buenas o malas segun las hace nuestra opinión" (Lisias)

Re: BTree max row size?

From
Alvaro Herrera
Date:
On Tue, Dec 21, 2004 at 12:51:05PM -0500, Ernest Kim wrote:

> I'm trying to use the tiki-wiki software.  It has several indexes
> which store the web page's data as an index criteria.  The problem
> comes up when a web page is a large web page.  It can't store the page
> in the index.

That's a strange indexing strategy.  What is it trying to do with those
indexes?

> Do you know of another way of dealing with this issue aside from
> re-compiling or recoding the indexes?

What issue?  You can't index arbitrarily long strings, period.  OTOH,
the task that the index is supposed to handle most likely can be handled
in a different way.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"¿Cómo puedes confiar en algo que pagas y que no ves,
y no confiar en algo que te dan y te lo muestran?" (Germán Poo)

Re: BTree max row size?

From
Ernest Kim
Date:
I'm trying to use the tiki-wiki software.  It has several indexes
which store the web page's data as an index criteria.  The problem
comes up when a web page is a large web page.  It can't store the page
in the index.

Do you know of another way of dealing with this issue aside from
re-compiling or recoding the indexes?

-Ernie

On Sat, Dec 18, 2004 at 12:20:29PM -0300, Alvaro Herrera wrote:
> On Thu, Dec 16, 2004 at 06:20:57PM -0500, Ernest Kim wrote:
>
> Hi,
>
> > I'm getting the following error message when I try to update a row in
> > a table:
> >
> > ERROR:  54000: index row size 2720 exceeds btree maximum, 2713
> >
> > Does anyone know how to to change the btree maximum row size?  How did
> > it come up with 2713 as a max row size?
>
> You could compile Postgres with BLCKSZ set to a higher value (currently
> 8192).  Or you could change your indexing strategy, because if you now
> want to store 2720 bytes, some other day you may want to store 11000,
> and then you would overflow the ~10900 bytes that a 32768 BLCKSZ would
> buy you.
>
> What are you indexing?
>
> The 2713 comes from (8192 - some overhead) / 3.
>
> --
> Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
> "Las cosas son buenas o malas segun las hace nuestra opinión" (Lisias)

Re: BTree max row size?

From
Martijn van Oosterhout
Date:
On Tue, Dec 21, 2004 at 12:51:05PM -0500, Ernest Kim wrote:
>
> I'm trying to use the tiki-wiki software.  It has several indexes
> which store the web page's data as an index criteria.  The problem
> comes up when a web page is a large web page.  It can't store the page
> in the index.
>
> Do you know of another way of dealing with this issue aside from
> re-compiling or recoding the indexes?

I think what he's trying to say is that there is no point sticking the
whole page in an index. It doesn't help for lookup, since you'd need to
know the whole page to use the index. It won't speed LIKE or regular
expressions. The question was basically: why are you trying to put the
whole page in an index since it is apparently useless...
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment