Re: Feature suggestions (long)

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SB SD
Тема Re: Feature suggestions (long)
Дата
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961FB3@m0114.s-mxs.net
обсуждение исходный текст
Ответ на Feature suggestions (long)  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Feature suggestions (long)  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
> But the RULE system is not really suited to this. I havn't written it
all
> out but by my calculations the number of rules required is about
(N^2+N)/2
> where N is the number of partitions. That's one UPDATE rule for each
pair of
> tables plus a set of INSERT rules (DELETE requires nothing special).
And
> each of those rules will be used every single time that table is
queried
> (both inserts and updates). That's not terribly efficient.
> Mind you, maybe there's a better way of doing it. I havn't totally
gotten my
> head around rules. Maybe it indicates that improvements could be made
to the
> rule system.

What you need is one view that is a union all select selecting all your
partial
tables, all applications only accesses this one view.
You need 1 insert 2 update 1 delete rule for each table plus 3 remainder
rules
(=4*N + 3 rules) (the select rule is already done by create view),
plus one check constraint for each partial table.

You can restrict access to the partial tables with normal
grant/revoke's.
The appls only need grants on the view (which is updateable with above
rules).

Andreas


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

Предыдущее
От: ohp@pyrenet.fr
Дата:
Сообщение: Interessting problem
Следующее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Removing width from EXPLAIN