Skip site navigation (1) Skip section navigation (2)

Re: Something's been bugging me

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Something's been bugging me
Date: 2007-09-29 17:41:01
Message-ID: 6388.1191087661@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> The idea that I recall mentioning was to expend another byte in TOAST
>> pointers to make them self-identifying, ie, instead of 0x80 or 0x01
>> signaling something that *must* be a 17-byte toast pointer, that bit
>> pattern signals "something else" and the content of the next byte
>> lets you know what.  So TOAST pointers would take 18 bytes instead of
>> 17, and there would be room for additions of other sorts of pointers.

> Here's a patch that does all of the above. 

I'd be inclined to make the second byte be the length and have
VARSIZE_1B_E depend on that --- any objection?

> 2) the test in tuptoaster.c could be

>         if (toast_isnull[i] || 
>             !VARATT_IS_EXTERNAL(new_value) ||
>             VARSIZE_EXTERNAL(old_value) != VARSIZE_EXTERNAL(new_value) ||
>             memcmp(VARDATA_SHORT(old_value),
>                    VARDATA_SHORT(new_value),
>                    VARSIZE_EXTERNAL(old_value)) != 0)

Yeah, I'd go with this just to avoid having hardwired knowledge of the
datum size here.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-09-29 18:45:40
Subject: Re: Nasty tsvector can make dumps unrestorable
Previous:From: Gregory StarkDate: 2007-09-29 16:22:54
Subject: Re: Something's been bugging me

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group