Re: WIP: Rework access method interface

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: WIP: Rework access method interface
Дата
Msg-id 55DC8963.9040306@BlueTreble.com
обсуждение исходный текст
Ответ на Re: WIP: Rework access method interface  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Ответы Re: WIP: Rework access method interface  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On 8/24/15 9:49 AM, Alexander Korotkov wrote:
> 2) Non-index access methods reuse pg_class.relam but don't reuse pg_am.
> This violates relational theory because single column reference multiple
> tables.
> 3) Non-index access methods reuse both pg_class.relam and pg_am. This
> violates relational theory because we store different objects in the
> same table.
>
> I'd say we already have precedent of #2. It's pg_depend which reference
> objects of arbitrary types.
> In the #3 we really shouldn't keep any specific to index am in pg_am.

In userspace, table inheritance handles this nicely. Stick a "type" 
field in the parent so you know what kind of entity each record is, 
along with all your common fields. Everything else is in the children, 
and code generally already knows which child table to hit or doesn't 
care about specifics and hits only the parent. Perhaps something similar 
could be made to work with a catalog table.

#2 seems like a twist on the same idea, except that there's fields in 
pg_class that tell you what the child is instead of a real parent table. 
Presumably we could still create a parent table even if the internals 
were going through pg_class.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: psql - better support pipe line
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: WIP: Rework access method interface