patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap - Mailing list pgsql-hackers

From Jameison Martin
Subject patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap
Date
Msg-id 1334679762.78696.YahooMailNeo@web39402.mail.mud.yahoo.com
Whole thread Raw
Responses Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap  (Simon Riggs <simon@2ndQuadrant.com>)
List 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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Parameterized-path cost comparisons need some work
Next
From: Christopher Browne
Date:
Subject: Re: Gsoc2012 idea, tablesample