Re: Fixed length datatypes. WAS [GENERAL] UUID's as - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Date
Msg-id 25576.1151690366@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fixed length datatypes. WAS [GENERAL] UUID's as  (mark@mark.mielke.cc)
List pgsql-hackers
mark@mark.mielke.cc writes:
> It depends how it is used. If the memory location needs to be
> allocated, for the value to be used only a few times, the overhead of
> allocation and redirection can be more expensive. If many though, than
> the reduction in value copying can make the pointer faster. 64-bytes,
> and 128-bytes are just on the line of not being clearly one or the
> other. It was just a thought though. The PostgreSQL API seemed pretty
> fixed the last time I looked at this stuff.

Yeah, changing the definition of Datum is probably out of the question ;-)
as it'd break not only most of core but every external module in existence.
Anything bigger than a "long" has to be pass-by-reference.  The
efficiency argument is wrong anyway, as we've optimized the heck out of
those code paths; very little actual copying happens unless a new value
is getting generated.  Pushing pointers around is definitely faster than
pushing multiword values around.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Next
From: "Marko Kreen"
Date:
Subject: [RFC] txid: module for 64-bit external transaction IDs