Обсуждение: Short row header

Поиск
Список
Период
Сортировка

Short row header

От
PFC
Дата:
    I have this "poll results" table with just 3 integer fields, which is
never updated, only inserted/deleted...
    Did the Devs consider an option to have VACUUM reduce the row header
sizes for tuples that are long commited and are currently visible to all
transactions ? (even if this makes the tuples non-updateable, as long as
they can be deleted, it would be OK for this type of tables).


Re: Short row header

От
Heikki Linnakangas
Дата:
PFC wrote:
>
>     I have this "poll results" table with just 3 integer fields, which
> is never updated, only inserted/deleted...
>     Did the Devs consider an option to have VACUUM reduce the row header
> sizes for tuples that are long commited and are currently visible to all
> transactions ?

That has been suggested before, but IIRC it wasn't considered to be
worth it. It would only save 4 bytes (the xmin field) per tuple, the
free space would be scattered around all pages making it less useful,
and having to deal with two different header formats would make
accessing the header fields more complex.

> (even if this makes the tuples non-updateable, as long as
> they can be deleted, it would be OK for this type of tables).

That would save another 6 bytes per tuple (ctid field), but we generally
stay away from things that impose limitations like that.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Re: Short row header

От
Gregory Stark
Дата:
"PFC" <lists@peufeu.com> writes:

>     I have this "poll results" table with just 3 integer fields, which is
> never updated, only inserted/deleted...
>     Did the Devs consider an option to have VACUUM reduce the row header
> sizes for tuples that are long commited and are currently visible to all
> transactions ? (even if this makes the tuples non-updateable, as long as  they
> can be deleted, it would be OK for this type of tables).

It wouldn't actually speed up anything unless the space it frees up was then
used by something. That would mean loading one of your polls into the small
bits of space freed up in every page. For most tables like this you want to do
large bulk loads and want your loads stored quickly in contiguous space so it
can be accessed quickly, not spread throughout the table.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com