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

Re: Eliminate more detoast copies for packed varlenas

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Eliminate more detoast copies for packed varlenas
Date: 2007-09-27 12:53:06
Message-ID: 37ed240d0709270553u20e5cd3fp9827d665bb387fd@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On 9/22/07, Gregory Stark <stark(at)enterprisedb(dot)com> wrote:
> Ok, this removes what should be most if not all of the call sites where we're
> detoasting text or byteas. In particular it gets all the regexp/like functions
> and all the trim/pad functions. It also gets hashtext and hash_any.

Looks like there's some more of this in src/tutorial/funcs.c and funcs_new.c.

On a related note, while I was trawling through header files trying to
wrap my head around all this toast and varlena business, I found the
following comment, in fmgr.h and reiterated in postgres.h:

<>
WARNING: It is only safe to use PG_DETOAST_DATUM_UNPACKED() and
VARDATA_ANY() if you really don't care about the alignment.
</>

Shouldn't this be PG_DETOAST_DATUM_PACKED()?  I'm emboldened by the
fact that there is no macro called PG_TOAST_DATUM_UNPACKED defined
anywhere in postgres.

Patch attached, in case I've got the right idea.

Regards,
BJ

Attachment: packed-comment.diff
Description: text/plain (1.8 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Brendan JurdDate: 2007-09-27 13:41:52
Subject: Re: Text <-> C string
Previous:From: Simon RiggsDate: 2007-09-27 11:56:51
Subject: Re: [FEATURE REQUEST] Streaming Onlinebackup (MaybeOFFTOPIC)

pgsql-patches by date

Next:From: Brendan JurdDate: 2007-09-27 13:41:52
Subject: Re: Text <-> C string
Previous:From: Magnus HaganderDate: 2007-09-27 09:59:44
Subject: Re: Warning is adjusted of pgbench.

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