Re: How many fields in a table are too many

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: How many fields in a table are too many
Дата
Msg-id 200306281804.h5SI4vH08131@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: How many fields in a table are too many  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How many fields in a table are too many  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Is this a TODO?
> >     When columns can be reordered, move varlena columns to the end?
>
> Yeah, if it's not in there already.  I remember seeing some Berkeley-era
> comments speculating that this would be a good thing to do.  Not sure if
> they're still in the code, or
>
> I believe that really what you want is fixed-width NOT NULL columns
> first, then fixed-width nullable, then var-width.  This ordering will
> improve the odds of actually being able to use the fixed offset for
> a particular column.

Added to TODO:

    * Automatically place fixed-width, NOT NULL columns first in a
      table

I like the idea of putting NOT NULL before NULL columns.

However, I am not sure how useful NOT NULL is in practice because there
are lots of columns that don't specify NOT NULL but have mostly nulls or
mostly non-nulls, which kills our caching --- what I was hoping to do
some day was to cache the null bitmask and offsets of the previous tuple
and use those if the new tuple has the same null bitmask as the previous
tuple.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: How many fields in a table are too many
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: How many fields in a table are too many