Re: Insert Data Into Tables Linked by Foreign Key

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Insert Data Into Tables Linked by Foreign Key
Дата
Msg-id 20100104125927.GV5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Insert Data Into Tables Linked by Foreign Key  (Yan Cheng Cheok <yccheok@yahoo.com>)
Список pgsql-general
On Mon, Jan 04, 2010 at 04:53:16AM -0800, Yan Cheng Cheok wrote:
> From general point of view, having 3 SQL statement wrapped in a
> single stored procedure shall perform better due to reduced overhead
> to communicate with SQL server. Is that true? Or that is my false
> assumption?

I'd be tempted to put them into a stored procedure/function.  Less round
trips to server, plan can be cached, and easier code maintenance.  You
also get the option of tightening up security, functions can be defined
as "security definer" and permissions on original tables reduced.

--
  Sam  http://samason.me.uk/

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

Предыдущее
От: Yan Cheng Cheok
Дата:
Сообщение: Re: Insert Data Into Tables Linked by Foreign Key
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: Insert Data Into Tables Linked by Foreign Key