Re: Table inheritance implementation.

Поиск
Список
Период
Сортировка
От Grzegorz Nowakowski
Тема Re: Table inheritance implementation.
Дата
Msg-id 1167985651.15397.15.camel@rohlik
обсуждение исходный текст
Ответ на Re: Table inheritance implementation.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Table inheritance implementation.  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
On czw, 2007-01-04 at 10:44 -0500, Tom Lane wrote:
> Grzegorz Nowakowski <krecik@e-wro.net> writes:
> > But I have another question: why can't be
> > inheritance implemented as implicit JOIN?
>
> Interesting thought, but joins are expensive --- this would be quite a
> lot slower than the current way, I fear, especially when you consider
> more than one level of inheritance.  Also, switching over to this would
> destroy the current usefulness of inheritance for partitioning.

Well, I never used partitioning and I don't know what it's worth but
just after sending my original mail I got another variant of the idea:
to duplicate columns (parent(p), child(p,c)), so inserts into child
update both parent's and child's index.  This way we trade space (common
columns are replicated along inheritance hierarchy) and some speed
(inserts into child are slower because they also have to update parent)
for some other speed (selects work without join penalty).  Yet still we
have the primary benefit: parent's constraints and indexes work as
expected.

I'm well aware that even if my idea has some merit, it won't be soon
when it goes into code, if ever.  I expect it would take small
revolution to make it.  Anyway, I tried.  :)

Best regards.
--
Grzegorz Nowakowski


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

Предыдущее
От: Gunnar Wagenknecht
Дата:
Сообщение: Re: Dependency conflicts on CentOS 4.4
Следующее
От: Devrim GUNDUZ
Дата:
Сообщение: Re: Dependency conflicts on CentOS 4.4