Re: [RFC] indirect toast tuple support

From: Greg Stark <stark(at)mit(dot)edu>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [RFC] indirect toast tuple support
Date: 2013-02-21 02:37:31
Message-ID: CAM-w4HN+yaV-LmtFrkZvOD8AhAOQN4HZ5WzyM6FaSE6wERafZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 21, 2013 at 2:32 AM, Greg Stark <stark(at)mit(dot)edu> wrote:
> On Tue, Feb 19, 2013 at 2:00 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> The only reasonable thing I can see us doing is renaming
>> varattrib_1b_e.va_len_1be into va_type and redefine VARSIZE_1B_E into a
>> switch that maps types into lengths. But I think I would put this off,
>> except placing a comment somewhere, until its gets necessary.
>
> Is there any reason to make it a switch before we actually have two
> types that happen to have the same length?
>
> It might make the code clearer if there was an enum with the (one)
> type listed but as long as all the enum values happen to have the
> value of the length of the struct then it makes heap_form_tuple and
> heap_deform_tuple marginally faster. (unless gcc can optimize away the
> whole switch statement which might be plausible, especially if it's
> just a few ?: expressions)

For what it's worth much of this was discussed at the time. I
originally wrote it as an enum and Tom changed it to a length byte,
specifically for performance reasons, and said we could always change
it back to an enum where some of the values just happened to be equal
to their length if we needed it:

http://www.postgresql.org/message-id/flat/82tzp7bbbh(dot)fsf(at)mid(dot)bfk(dot)de#82tzp7bbbh(dot)fsf@mid.bfk.de

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joachim Wieland 2013-02-21 02:49:24 Re: posix_fadvise missing in the walsender
Previous Message Greg Stark 2013-02-21 02:32:13 Re: [RFC] indirect toast tuple support