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

Re: Eliminate more detoast copies for packed varlenas

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Brendan Jurd" <direvus(at)gmail(dot)com>
Cc: "Gregory Stark" <stark(at)enterprisedb(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Eliminate more detoast copies for packed varlenas
Date: 2007-09-27 21:04:32
Message-ID: 14816.1190927072@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
"Brendan Jurd" <direvus(at)gmail(dot)com> writes:
> 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.

Well, those are just tutorial code, so I'd vote for keeping it simple.

> 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()?

Yup, good catch.  In the context of fmgr.h, it seems like the comment
is more sensible if it refers to the underlying function
pg_detoast_datum_packed (which is what the preceding paragraph is
speaking of), so I made it say that instead.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Zdenek.KotalaDate: 2007-09-27 21:32:05
Subject: Re: [pgsql-packagers] Getting to 8.3 beta1
Previous:From: Stephen FrostDate: 2007-09-27 19:55:07
Subject: Re: Getting to 8.3 beta1

pgsql-patches by date

Next:From: Hiroshi SaitoDate: 2007-09-28 01:42:44
Subject: Re: Warning is adjusted of pgbench.
Previous:From: Tom LaneDate: 2007-09-27 20:45:36
Subject: Re: Warning is adjusted of pgbench.

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