Re: Why are stored procedures looked on so negatively?

Поиск
Список
Период
Сортировка
От Gauthier, Dave
Тема Re: Why are stored procedures looked on so negatively?
Дата
Msg-id 0AD01C53605506449BA127FB8B99E5E16832A12D@FMSMSX114.amr.corp.intel.com
обсуждение исходный текст
Ответ на Why are stored procedures looked on so negatively?  (Some Developer <someukdeveloper@gmail.com>)
Ответы Re: Why are stored procedures looked on so negatively?
Список pgsql-general
I find stored procedures to be a God-send.  The alternative, external code, is the risky, difficult and often poorer
performingapproach to the problems sp's solve.   What better way to interact programatically with your database than
WITHyour database? 

The only people that I see frown upon them don't understand them, are afraid of them, and so find ways to justify their
viewsabout them in negative terms.  I suppose that's human nature.  But once they get "turned on" to stored procedures,
theirviews change.   

As for selling sp's to them, especially if they are management, there's nothing more convincing than a demo.  And a
realgood way to demo their effectiveness is through a remote connection, preferrably across a time zone or two, where
thetask involves many (hundreds of thousands) of queries that the external script would have to do one at a time, over
thenet.  The sp would just run them inside as part of the sp call, locally, in a tiny fraction of the time.   



-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Some Developer
Sent: Tuesday, July 23, 2013 8:29 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Why are stored procedures looked on so negatively?

I've done quite a bit of reading on stored procedures recently and the consensus seems to be that you shouldn't use
themunless you really must. 

I don't understand this argument. If you implement all of your logic in the application then you need to make a network
requestto the database server, return the required data from the database to the app server, do the processing and then
returnthe results. A stored procedure is going to be a lot faster than that even if you just take away network latency
/transfer time. 

I'm in the middle of building a database and was going to make extensive use of stored procedures and trigger functions
becauseit makes more sense for the actions to happen at the database layer rather than in the app layer. 

Should I use them or not?


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Why are stored procedures looked on so negatively?
Следующее
От: Some Developer
Дата:
Сообщение: Re: Why are stored procedures looked on so negatively?