If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Why Not Use Stored Procedures In MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-10, 11:56
pinkfloyd43 pinkfloyd43 is offline
Registered User
 
Join Date: Dec 2010
Posts: 39
Why Not Use Stored Procedures In MySQL

MySQL v5.x, just starting working with a group of PHP developers and am responsible for database creation. One of the first items I talked about was using 'stored procedures' to database access as I have years of experience with them on other products. I was responded to with No, No, No, it can't do this, it can't do that, etc.

I have read an article about SP's not being compiled into the database which takes away my performance argument, if it's true. I don't trust everything I read and wanted to get as many opinions as possible as I personally like stored procedures for any database interaction.

Thanks!
From The Dark Side Of The Moon
Reply With Quote
  #2 (permalink)  
Old 12-03-10, 12:26
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
this is not a technical question, but rather, office power and politics

you are the DBA, just lay down the law

and if you can't, then, well... what was the question again?

of course, if someone says "stored procs can't do such-and-such" then you must either grant an exception or propose a workaround

what did they say you can't do in stored procs?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-03-10, 12:35
pinkfloyd43 pinkfloyd43 is offline
Registered User
 
Join Date: Dec 2010
Posts: 39
I somewhat thought this......So there is no technical reason?

It was quick but the developers said that there were problems and they should not be used, which I was thinking W H A T..



this is not a technical question, but rather, office power and politics

you are the DBA, just lay down the law

and if you can't, then, well... what was the question again?

of course, if someone says "stored procs can't do such-and-such" then you must either grant an exception or propose a workaround

what did they say you can't do in stored procs?
Reply With Quote
  #4 (permalink)  
Old 12-03-10, 13:09
bsdtux bsdtux is offline
Registered User
 
Join Date: Dec 2010
Posts: 5
@pinkfloyd43 - Your question intrigued me a little because I was always told that they increase performance because the data processing was being done by the server. After looking around a bit here is a snipit I got from MySQL that supports your argument that they should look into Stored Procedures.

Quote:
Stored routines can provide improved performance because less information needs to be sent between the server and the client. The tradeoff is that this does increase the load on the database server because more of the work is done on the server side and less is done on the client (application) side. Consider this if many client machines (such as Web servers) are serviced by only one or a few database servers.
In your case if it would be say a 1 to 1 ratio then I would think the DB server would be more than cable at producing the results faster.
Reply With Quote
  #5 (permalink)  
Old 12-03-10, 14:26
pinkfloyd43 pinkfloyd43 is offline
Registered User
 
Join Date: Dec 2010
Posts: 39
THE Fulusio

I agree 100%. There is an article out on the web somewhere, found it yesterday, in regards to mySQL and it NOT precompiling SQL statements and saving on the server. If I recall correctly is indicated that they are stored associated with a connection? Which did not make alot of sense to me.

Thanks!
Reply With Quote
  #6 (permalink)  
Old 12-05-10, 06:06
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 623
Performance improvement is one aspect but if you have all your business logic in stored procedures it means that we can then use different programming languages PHP, JSP, C ... that focuses purely on the presentation.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
Reply

Tags
mysql, stored procedures

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On