Re: copy.c allocation constant

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: copy.c allocation constant
Date: 2018-01-24 03:14:14
Message-ID: 20180124031414.GD17109@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 28, 2017 at 11:51:28AM -0500, Andrew Dunstan wrote:
>
>
> While reading copy.c I noticed this line:
>
>
> #define RAW_BUF_SIZE 65536        /* we palloc RAW_BUF_SIZE+1 bytes */
>
>
> Doesn't that seem rather odd? If we're adding 1 wouldn't it be better as
> 65535 so we palloc a power of 2?
>
>
> I have no idea if this affects performance, but it did strike me as strange.

Coming in late here, but it does seem very odd.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2018-01-24 03:22:47 Re: pgindent run?
Previous Message Amit Kapila 2018-01-24 02:56:45 Re: pgsql: Allow UPDATE to move rows between partitions.