VACUUM ANALYZE and tuple size

From: Mikhail Terekhov <terekhov(at)emc(dot)com>
To: Postgres Hackers List <hackers(at)postgresql(dot)org>
Subject: VACUUM ANALYZE and tuple size
Date: 1999-07-02 18:43:28
Message-ID: 377D0850.5EB41EE7@emc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I've encountered a strange behavior of the VACUUM ANALYZE command.
It seems that this command works only if the size of a text field
does not exceed approximately 4050 bytes! So the real limit on
tuple size is a half of the max tuple size. I've checked this effect
on Postgres 6.4.2 (Sparc Solaris 2.5.1) and Postgres 6.5 (SUSE 6.1
Linux, kernel 2.2.5). Is this a bug or known feature?
The python script used to reproduce this problem and results for
v6.4.2 and v6.5 are follows.

Regards,
Mikhail

===================================================================
#! /usr/bin/env python

import sys, pg

con = pg.connect('test', '', 5432, None, None)

try:
con.query("CREATE TABLE tmp (t text)")
except:
pass

for i in range(100) :
s = 'X'*(4050 +i)
print "size= %d" % len(s)
con.query("DROP TABLE tmp")
con.query("CREATE TABLE tmp (t text)")
con.query("INSERT INTO tmp (t) VALUES ('%s')" % s)
try:
con.query("VACUUM ANALYZE tmp")
except pg.error,msg:
print msg
sys.exit()

print "OK"
===================================================================

SunOS luc1 5.5.1 Generic_105428-01 sun4u sparc SUNW,Ultra-5_10
python vacuum_chk.py
size= 4050
size= 4051
size= 4052
size= 4053
size= 4054
size= 4055
size= 4056
size= 4057
ERROR: Tuple is too big: size 8184

===================================================================

Linux luc2 2.2.5 #4 Tue Apr 13 16:51:36 MEST 1999 i686 unknown
vacuum_chk.py
size= 4050
size= 4051
size= 4052
size= 4053
size= 4054
size= 4055
size= 4056
size= 4057
size= 4058
size= 4059
size= 4060
size= 4061
size= 4062
size= 4063
size= 4064
size= 4065
ERROR: Tuple is too big: size 8188

===================================================================

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-07-02 21:26:40 Re: sgml tool
Previous Message Lamar Owen 1999-07-02 18:34:13 Re: [HACKERS] Re: First 6.5 RPMs