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

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
Cc: robertmhaas(at)gmail(dot)com, josh(at)agliodbs(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap [Review]
Date: 2012-12-24 14:13:32
Message-ID: CA+U5nM+j23n0FqLM3AADefrXheH1Ln==HYQ3ubcVdqRHOiWtkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 24 December 2012 13:13, Amit Kapila <amit(dot)kapila(at)huawei(dot)com> wrote:

> Apart from above, the performance data for less number of columns (where the
> trailing nulls are such that they cross word boundary) also show similar
> gains:
>
> The below cases (2 & 3) can give benefit as it will save 4 bytes per tuple
>
> 2. Table with 12 columns (first 3 integer followed by 9 Boolean columns)
> A. INSERT tuples with 9 trailing nulls
> B. UPDATE last column value to "non-null"
> C. UPDATE last column value to "null"
> ---------------------+---------------------+---------------------
> Original Code | Trim Tailing NULLs | Improvement (%)
> TPS space used| TPS space used | Results
> (pages) | (pages) |
> ---------------------+---------------------+----------------------
> 2A: 0.8485 12739 | 0.8524 10811 | 0.4% 15.1%
> 2B: 0.5847 25478 | 0.5749 23550 | -1.5% 7.5%
> 2C: 0.5591 38217 | 0.5545 34361 | 0.8% 10.0%
>
>
> 3. Table with 12 columns (first 3 integer followed by 9 Boolean columns)
> A. INSERT tuples with 4 trailing nulls
> B. UPDATE last column value to "non-null"
> C. UPDATE last column value to "null"
> ---------------------+---------------------+---------------------
> Original Code | Trim Tailing NULLs | Improvement (%)
> TPS space used| TPS space used | Results
> (pages) | (pages) |
> ---------------------+---------------------+----------------------
> 3A: 0.8443 14706 | 0.8626 12739 | 2.3% 13.3%
> 3B: 0.5307 29412 | 0.5272 27445 | -0.6% 6.7%
> 3C: 0.5102 44118 | 0.5218 40184 | 2.2% 8.9%
>
> As a conclusion point, I would like to say that this patch doesn't have
> performance regression for most used scenario's
> and it gives benefit in some of the trailing null's cases.

Not really sure about the 100s of columns use case.

But showing gain in useful places in these more common cases wins my vote.

Thanks for testing. Barring objections, will commit.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2012-12-24 14:28:10 Re: Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap [Review]
Previous Message Amit Kapila 2012-12-24 13:13:23 Re: Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap [Review]