patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap

From: Jameison Martin <jameisonb(at)yahoo(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap
Date: 2012-04-17 16:22:42
Message-ID: 1334679762.78696.YahooMailNeo@web39402.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following patch truncates trailing null attributes from heap rows to reduce the size of the row bitmap. 

Applications often have wide rows in which many of the trailing column values are null. On an insert/update, all of the trailing null columns are tracked in the row bitmap. This can add a substantial overhead for very wide rows. This change truncates heap rows such that the trailing nulls are elided. 

The intuition for this change is that ALTER TABLE t ADD COLUMN c type NULL is a metadata only change. Postgres works fine when a row's metadata (tuple descriptor) is inconsistent with the actual row data: extra columns are assumed to be null. This change just adjusts the number of attributes for a row and the row bitmap to only track up to the last non-null attribute.

Thanks.

-Jamie Martin

Attachment Content-Type Size
0001-Truncate-trailing-null-attributes-from-heap-rows-to-.patch application/octet-stream 25.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Browne 2012-04-17 16:33:04 Re: Gsoc2012 idea, tablesample
Previous Message Tom Lane 2012-04-17 16:14:41 Re: Parameterized-path cost comparisons need some work