Andres Freund <and...@anarazel.de> writes: > On 2015-05-10 12:09:41 -0400, Tom Lane wrote: >> Andres Freund <and...@anarazel.de> writes: >>> * The VARTAG_IS_EXPANDED(tag) trick in VARTAG_SIZE is unlikely to >>> beneficial, before the compiler could implement the whole thing as a >>> computed goto or lookup table, afterwards not.
>> Well, if you're worried about the speed of VARTAG_SIZE() then the right >> thing to do would be to revert your change that made enum vartag_external >> distinct from the size of the struct, so that we could go back to just >> using the second byte of a varattrib_1b_e datum as its size. As I said >> at the time, inserting pad bytes to force each different type of toast >> pointer to be a different size would probably be a better tradeoff than >> what commit 3682025015 did. > I doubt that'd be a net positive. Anyway, all I'm saying is that I can't > see the VARTAG_IS_EXPANDED trick being beneficial in comparison to > checking both explicit values. I did some microbenchmarking on this, and AFAICT doing it your way makes it slower. I still think that going back to defining the second byte as the size would be better. Fortunately, since this is only a matter of in-memory representations, we aren't committed to any particular answer. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers