Re: How many fields in a table are too many

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How many fields in a table are too many
Дата
Msg-id 23503.1056681607@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How many fields in a table are too many  (<btober@seaworthysys.com>)
Ответы Re: How many fields in a table are too many  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-general
<btober@seaworthysys.com> writes:
>> As long as we are playing "who's is biggest", I have one with 900+
>> attributes (normalized) but there is a big warning - if you have a
>> query that returns hundreds of columns it will be very, very slow.

> Is the SELECT * the only circumstance? That is, if you specify a small
> number of columns, does the response improve even though the table
> actually has that large number of columns but is only be asked to supply
> a column-limited result set?

IIRC, the worst problems that Steve's profile exposed were associated
with large numbers of columns in a SELECT result --- there are some
doubly nested loops that take time O(N^2) in the number of columns.
But I would not be surprised if some of those loops get invoked on the
underlying table, too, depending on what your query looks like exactly.

This is all eminently fixable, it's just a matter of someone finding
some round tuits ... for most people it doesn't seem like a
high-priority problem, since you won't notice it till you get into the
hundreds of columns ...

            regards, tom lane

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

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