Re: Reducing tuple overhead

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, <hlinnaka(at)iki(dot)fi>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, <jd(at)commandprompt(dot)com>
Subject: Re: Reducing tuple overhead
Date: 2015-04-23 16:42:24
Message-ID: 553920F0.8030206@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4/23/15 11:24 AM, Andres Freund wrote:
> I do wonder what, in realistic cases, is actually the bigger contributor
> to the overhead. The tuple header or the padding we liberally add in
> many cases...

Assuming you're talking about padding between fields...

Several years ago Enova paid Command Prompt to start work on logical
column ordering, and part of the motivation for that was to allow
re-ordering physical tuples into the most efficient on-disk format
possible. I think I did some tests re-arranging some tables into the
theoretically most efficient order and measuring heap size. I think
there was some modest size improvement, maybe 10-15%? This was several
years ago so it's all foggy. Maybe Josh can find some of this in CMD's
ticketing system?

Aside from that, something else that might be interesting is Tom's
recent work on decoupling on-page representation of types from what's
passed around internally. That might offer some gains here, even if it's
just in reducing the need for alignment.

I also wonder if a similar technique would be useful at the tuple level.
One possibility would be attempting to compress the tuple before putting
it on the page.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2015-04-23 16:45:37 Re: Reducing tuple overhead
Previous Message Jim Nasby 2015-04-23 16:31:32 Re: Freeze avoidance of very large table.