Re: Manipulating complex types as non-contiguous structures in-memory
От | Tom Lane |
---|---|
Тема | Re: Manipulating complex types as non-contiguous structures in-memory |
Дата | |
Msg-id | 12650.1431564531@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Manipulating complex types as non-contiguous structures in-memory (Andres Freund <andres@anarazel.de>) |
Ответы |
Re: Manipulating complex types as non-contiguous
structures in-memory
|
Список | pgsql-hackers |
Andres Freund <andres@anarazel.de> writes: > On 2015-05-10 12:09:41 -0400, Tom Lane wrote: >> Andres Freund <andres@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
В списке pgsql-hackers по дате отправления: