Re: Stored Procedures vs Dynamic SQL generated by ORM ?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Stored Procedures vs Dynamic SQL generated by ORM ?
Дата
Msg-id dcc563d10711270930j2f553c5eg6e11f3950ee80813@mail.gmail.com
обсуждение исходный текст
Ответ на Stored Procedures vs Dynamic SQL generated by ORM ?  (Alagu Madhu <almadhu@gmail.com>)
Список pgsql-general
On Nov 27, 2007 1:57 AM, Alagu Madhu <almadhu@gmail.com> wrote:
>
> Which is the best Stored Procedures or Dynamic SQL generated by ORM ?

Depends on what you mean by best.  Dynamic SQL costs more in the
planning stage because the db has to plan out each statement before
running it.  However, it can consider the actual values in the queries
when creating those plans, so you get individually optimized plans for
each query.  Generally speaking Stored Procs (UDFs in pgsql) use
static query  / execution plans created at the time the UDF was
brought into being.

You should also considered prepared SQL from the client side as well.
Not sure if your ORM supports that or not.

Not a fan of ORM, but it's a necessary evil sometimes. :)

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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Non-unique values problem after 'add column'
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: Stored Procedures vs Dynamic SQL generated by ORM ?