public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Save a few bytes in pg_attribute
Date: Mon, 20 Mar 2023 10:37:36 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Peter Eisentraut <[email protected]> writes:
> After the discussion in [0] ff., I was looking around in pg_attribute 
> and noticed that we could possibly save 4 bytes.  We could change both 
> attstattarget and attinhcount from int4 to int2, which together with 
> some reordering would save 4 bytes from the fixed portion.

> attstattarget is already limited to 10000, so this wouldn't lose 
> anything.  For attinhcount, I don't see any documented limits.  But it 
> seems unlikely to me that someone would need more than 32k immediate 
> inheritance parents on a column.  (Maybe an overflow check would be 
> useful, though, to prevent shenanigans.)

> The attached patch seems to work.  Thoughts?

I agree that attinhcount could be narrowed, but I have some concern
about attstattarget.  IIRC, the limit on attstattarget was once 1000
and then we raised it to 10000.  Is it inconceivable that we might
want to raise it to 100000 someday?

			regards, tom lane






view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Save a few bytes in pg_attribute
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox