Re: VARIANT / ANYTYPE datatype - Mailing list pgsql-hackers

From Tom Lane
Subject Re: VARIANT / ANYTYPE datatype
Date
Msg-id 20824.1304557387@sss.pgh.pa.us
Whole thread Raw
In response to Re: VARIANT / ANYTYPE datatype  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: VARIANT / ANYTYPE datatype  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> As a followup idea there exists the desire to store records as records
> and not text representation of same (given differing record types, of
> course), for which it'd be more worthwhile.

Maybe.  The conventional wisdom is that text representation of data is
more compact than PG's internal representation by a significant factor
--- our FAQ says up to 5x, in fact.  I know that that's including row
overhead and indexes and so on, but I still don't find it to be a given
that you're going to win on space with this sort of trick.

Another point here is that once the values in question get to be any
significant number of bytes apiece, both text and the proposed VARIANT
representation could be subject to compression, which would greatly
reduce any nominal advantage of one over the other.  Any
representational inefficiency in either would just be grist for the
compressor.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Some surprising precedence behavior in PG's grammar
Next
From: Greg Stark
Date:
Subject: Re: Some surprising precedence behavior in PG's grammar