Tuple length limit

Started by Bruce Momjianover 26 years ago8 messages
#1Bruce Momjian
maillist@candle.pha.pa.us

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, Pennsylvania 19026
#2Stupor Genius
stuporg@erols.com
In reply to: Bruce Momjian (#1)
RE: [HACKERS] Tuple length limit

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

#3Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Stupor Genius (#2)
Re: [HACKERS] Tuple length limit

[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, Pennsylvania 19026
#4Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Bruce Momjian (#1)
Re: [HACKERS] Tuple length limit

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));
CREATE
test=> insert into test values ('x');
INSERT 21417 1
test=> insert into test values ('x');
INSERT 21418 1
test=> insert into test values ('x');
INSERT 21419 1
test=> insert into test values ('x');
INSERT 21420 1
test=> vacuum;
VACUUM
test=> delete from test;
DELETE 4
test=> 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, Pennsylvania 19026
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#4)
Re: [HACKERS] Tuple length limit

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

#6Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Tom Lane (#5)
Re: [HACKERS] Tuple length limit

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, Pennsylvania 19026
#7Mikhail Terekhov
terekhov@emc.com
In reply to: Tom Lane (#5)
Re: [HACKERS] Tuple length limit

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

Regards,
Mikhail

Tom Lane wrote:

Show quoted text

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

#8Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Mikhail Terekhov (#7)
Re: [HACKERS] Tuple length limit

[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, Pennsylvania 19026