Re: How many views is ok?

От: Tom Lane
Тема: Re: How many views is ok?
Дата: ,
Msg-id: 5059.1124066280@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: How many views is ok?  ("Petr Kavan")
Список: pgsql-performance

Скрыть дерево обсуждения

How many views is ok?  ("Petr Kavan", )
 Re: How many views is ok?  (John Arbash Meinel, )
 Re: How many views is ok?  (Tom Lane, )
 Re: How many views is ok?  ("Petr Kavan", )

"Petr Kavan" <> writes:
> Possibility is to create a view for each employee that chooses only his data
> and give employee privileges to this view. But I am not sure if such number
> of views does not have some performance drawbacks or even if postgre can
> support it (I expect i can).

Do you really need more than one view?  I'd consider something like

    create view emp_view as select * from emp where name = current_user;

This requires that your Postgres usernames match up with something in
the underlying table, of course.

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: "Petr Kavan"
Дата:
Сообщение: Re: How many views is ok?
От: "Magnus Hagander"
Дата:
Сообщение: Re: Performance pb vs SQLServer.