Thread: Tuple length limit

Tuple length limit

From
Bruce Momjian
Date:
Can someone tell me what the maximum tuple length is?  Is it sort of
BLCKSZ or BLCKSZ/2?  I don't remember if we require the ability to have
at least two tuples in a block.


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


RE: [HACKERS] Tuple length limit

From
"Stupor Genius"
Date:
> Can someone tell me what the maximum tuple length is?  Is it sort of
> BLCKSZ or BLCKSZ/2?  I don't remember if we require the ability to have
> at least two tuples in a block.

IIRC, the max tuple size was always intended to be BLCKSZ, it's just the max
size of the text fields that were 4096.  I don't remember any discussions
ever on this list about trying to control the # of tuples stored per block.

Hope this helps...

Darren



Re: [HACKERS] Tuple length limit

From
Bruce Momjian
Date:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> > Can someone tell me what the maximum tuple length is?  Is it sort of
> > BLCKSZ or BLCKSZ/2?  I don't remember if we require the ability to have
> > at least two tuples in a block.
> 
> IIRC, the max tuple size was always intended to be BLCKSZ, it's just the max
> size of the text fields that were 4096.  I don't remember any discussions
> ever on this list about trying to control the # of tuples stored per block.
> 

That is what I found too, but vacuum seems to use BLCKSZ/2, varchar uses
BLCKSZ/2, and tuple size is BLCKSZ.  Doesn't make any sense.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Tuple length limit

From
Bruce Momjian
Date:
> Can someone tell me what the maximum tuple length is?  Is it sort of
> BLCKSZ or BLCKSZ/2?  I don't remember if we require the ability to have
> at least two tuples in a block.

Here is what I found with the new code.  Seems it works.

---------------------------------------------------------------------------test=> create table test (x
char(8104));CREATEtest=>insert into test values ('x');INSERT 21417 1test=> insert into test values ('x');INSERT 21418
1test=>insert into test values ('x');INSERT 21419 1test=> insert into test values ('x');INSERT 21420 1test=>
vacuum;VACUUMtest=>delete from test;DELETE 4test=> vacuum;VACUUM
 


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Tuple length limit

From
Tom Lane
Date:
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>> Can someone tell me what the maximum tuple length is?

I had always thought that the limit was supposed to be BLCKSZ less
overhead.

> Here is what I found with the new code.  Seems it works.
>     test=> vacuum;
>     VACUUM

Wasn't the complaint that started this thread something about "peculiar
behavior" of VACUUM with big tuples?  Might be wise to check VACUUM more
closely.
        regards, tom lane


Re: [HACKERS] Tuple length limit

From
Bruce Momjian
Date:
> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> >> Can someone tell me what the maximum tuple length is?
> 
> I had always thought that the limit was supposed to be BLCKSZ less
> overhead.
> 
> > Here is what I found with the new code.  Seems it works.
> >     test=> vacuum;
> >     VACUUM
> 
> Wasn't the complaint that started this thread something about "peculiar
> behavior" of VACUUM with big tuples?  Might be wise to check VACUUM more
> closely.

We were inconsistent.  Varchar and vacuum where BLCKSZ/2, while others
where BLCKSZ, of course minus overhead.  The new code is consistent, and
does proper padding.  I even got rid of a fudge factor in rewrite
storage by using the actual rewrite lengths.

Will be in 6.5.1.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Tuple length limit

From
Mikhail Terekhov
Date:
As a matter of fact, VACUUM works just fine in my case.
It is VACUUM ANALYSE which doesn't.

Regards,
Mikhail

Tom Lane wrote:
> 
> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> >> Can someone tell me what the maximum tuple length is?
> 
> I had always thought that the limit was supposed to be BLCKSZ less
> overhead.
> 
> > Here is what I found with the new code.  Seems it works.
> >       test=> vacuum;
> >       VACUUM
> 
> Wasn't the complaint that started this thread something about "peculiar
> behavior" of VACUUM with big tuples?  Might be wise to check VACUUM more
> closely.
> 
>                         regards, tom lane


Re: [HACKERS] Tuple length limit

From
Bruce Momjian
Date:
[Charset koi8-r unsupported, filtering to ASCII...]
> As a matter of fact, VACUUM works just fine in my case.
> It is VACUUM ANALYSE which doesn't.

Good point.  Works for me now.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026