Re: Manipulating complex types as non-contiguous structures in-memory
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Pavel Stehule <pavel.stehule@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2015-05-14T01:19:54Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > On 2015-05-13 21:01:43 -0400, Tom Lane wrote: >> It is, but why would it be a disaster? We could add StaticAsserts >> verifying that the sizes actually are different. I doubt that the pad >> space itself could amount to any issue performance-wise, since it would >> only ever exist in transient in-memory tuples, and even that only seldom. > The sizes would be platform dependant. So what? There are lots of platform-dependent constants in PG. > It's also just incredibly ugly to > have to add pad bytes to structures so we can disambiguate them. Well, I agree it's not too pretty, but you were the one who brought up the issue of the speed of VARTAG_SIZE(). We definitely gave up some performance there already, and my patch will make it worse. > Anyway, I think we can live with your & or my proposed additional branch > for now. I can't see either variant being a relevant performance > bottleneck anytime soon. Actually, after having microbenchmarked the difference between those two proposals, I'm not too sure that VARTAG_SIZE() is down in the noise. But it doesn't matter for the moment --- any one of these alternatives would be a very localized code change, and none of them would create an on-disk compatibility break. We can let it go until someone wants to put together a more definitive benchmark for testing. regards, tom lane
Commits
-
Use fast path in plpgsql's RETURN/RETURN NEXT in more cases.
- 9e3ad1aac524 9.5.0 cited
-
Add support for multiple kinds of external toast datums.
- 368202501539 9.4.0 cited