Re: VARIANT / ANYTYPE datatype

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VARIANT / ANYTYPE datatype
Date: 2011-05-05 17:19:29
Message-ID: 4DC2DC21.7000505@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05/05/2011 01:00 PM, Jim Nasby wrote:
> On May 4, 2011, at 6:24 PM, Andrew Dunstan wrote:
>> I'm far from convinced that storing deltas per column rather than per record is a win anyway. I don't have hard numbers to hand, but my vague recollection is that my tests showed it to be a design that used more space.
> It depends on how many fields you're changing in one go and how wide the table is. It's also a PITA to identify what fields actually changed if you're storing everything.

No it's not. Instead of storing OLD/NEW, store a base record and a delta
record (an hstore with just the changed fields) for an update. This
saves space and means you only have to calculate what changed once.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-05-05 17:22:18 Re: FDW table hints
Previous Message Thom Brown 2011-05-05 17:15:15 Re: Unlogged vs. In-Memory