Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2010
    Posts
    39

    Unanswered: 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

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    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?

  4. #4
    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.

    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.

  5. #5
    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!

  6. #6
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    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
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •