On Fri, Mar 30, 2018 at 10:08 AM, Andrew Dunstan <andrew.duns...@2ndquadrant.com> wrote: > On Fri, Mar 30, 2018 at 5:00 AM, Andres Freund <and...@anarazel.de> wrote:
[ missing values are loaded in the TupleDesc by RelationBuildTupleDesc ] >>> > I'm still strongly object to do doing this unconditionally for queries >>> > that never need any of this. We're can end up with a significant number >>> > of large tuples in memory here, and then copy that through dozens of >>> > tupledesc copies in queries. >> >>> We're just doing the same thing we do for default values. >> >> That's really not a defense. It's hurting us there too. >> > > > I will take a look and see if it can be avoided easily. > > For missing values there are three places where we would need to load them on demand: getmissingattr(), slot_getmissingattrs() and expand_tuple(). However, none of those functions have obvious access to the information required to load the missing values. We could probably do something very ugly like getting the relid from the TupleDesc's first attribute. Maybe someone else has a better option. But I can't see a simple and clean way to do this. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services