Re: inheritance performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: inheritance performance
Дата
Msg-id 24996.1106425342@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: inheritance performance  (Greg Stark <gsstark@mit.edu>)
Список pgsql-performance
Greg Stark <gsstark@mit.edu> writes:
> ken <southerland@samsixedd.com> writes:
>> From my understanding, all the data for these columns in all the child
>> tables will be stored in this one parent table

> No, all the data is stored in the child table.

Correct ...

>> and that, furthermore, there is a "hidden" column in the parent table called
>> tableoid that allows postgres to determine which row is stored in which
>> child table.

> That's true.
> There's a performance hit for the extra space required to store the tableoid.

Bzzzt ...

tableoid isn't actually stored anywhere on disk.  It's a pseudo-column
that is generated during row fetch.  (It works for all tables, not only
inheritance children.)

>> Given that, is there a performance hit for queries on the child tables
>> because postgres has to effectively put a condition on every query based on
>> the tableoid of the given child table?

AFAIR, a query directed specifically to a child table is *completely*
unaware of the fact that that table is a child.  Only queries directed
to a parent table, which have to implicitly UNION in the children, pay
any price for inheritance.

            regards, tom lane

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: PostgreSQL clustering VS MySQL clustering
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL clustering VS MySQL clustering