Re: Save a few bytes in pg_attribute

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Save a few bytes in pg_attribute
Date: 2023-03-20 14:37:36
Message-ID: 933390.1679323056@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-03-20 14:44:43 Re: Question: Do we have a rule to use "PostgreSQL" and "<productname>PostgreSQL</productname>" separately?
Previous Message Masahiko Sawada 2023-03-20 14:34:08 Re: [PoC] Improve dead tuple storage for lazy vacuum