Re: Manipulating complex types as non-contiguous structures in-memory

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Manipulating complex types as non-contiguous structures in-memory
Date: 2015-02-10 23:19:12
Message-ID: 3159.1423610352@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> writes:
> Without having read the patch, I think this is great. I've been wishing
> for something like this while working on my variant data type.

> Are there any cases where we would want to use this on a non-variant?
> Perhaps types where we're paying an alignment penalty?

What do you mean by non-variant?

The use cases that have come to mind for me are:

* arrays, of course
* composite types (records)
* PostGIS geometry type
* JSONB, hstore
* possibly regex patterns (we could invent a data type representing these
and then store the compiled form as a deserialized representation;
although there would be some issues to be worked out to get any actual
win, probably)

The principal thing that's a bit hard to figure out is when it's a win to
convert to a deserialized representation and when you should just leave
well enough alone. I'm planning to investigate that further in the
context of plpgsql array variables, but I'm not sure how well those
answers will carry over to datatypes that plpgsql has no intrinsic
understanding of.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2015-02-10 23:55:12 Typo in logicaldecoding.sgml
Previous Message Jim Nasby 2015-02-10 23:09:57 Re: Manipulating complex types as non-contiguous structures in-memory