Re: Save a few bytes in pg_attribute

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Save a few bytes in pg_attribute
Дата
Msg-id 957494.1679336003@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Save a few bytes in pg_attribute  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-hackers
Tomas Vondra <tomas.vondra@enterprisedb.com> writes:
> IMHO it'd be much better to just not store the statistics target for
> attributes that have it default (which we now identify by -1), or for
> system attributes (where we store 0). I'd bet vast majority of systems
> will just use the default / GUC value. So if we're interested in saving
> these bytes, we could just store NULL in these cases, no?

Hmm, we'd have to move it to the nullable part of the row and expend
more code to fetch it; but I don't think it's touched in many places,
so that might be a good tradeoff.  Couple of notes:

* As things stand I think we have a null bitmap in every row of
pg_attribute already (surely attfdwoptions and attmissingval are never
both filled), so there's no extra cost there.

* Putting it in the variable part of the row means it wouldn't appear
in tuple descriptors, but that seems fine.

I wonder if the same is true of attinhcount.  Since it's nonzero for
partitions' attributes, it might be non-null in a fairly large fraction
of pg_attribute rows in some use-cases, but it still seems like we'd not
be losing anything.  It wouldn't need to be touched in any
high-performance code paths AFAICS.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Fix alter subscription concurrency errors
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Make ON_ERROR_STOP stop on shell script failure