Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6692787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:54:28+00:00 2026-05-26T05:54:28+00:00

Is it worth coding in stored procedures or in the code (or separate class).

  • 0

Is it worth coding in stored procedures or in the code (or separate class).

I read somewhere that stored procedures are faster in their execution, because they sit on the database, and it doesn’t need to make the interpretation stage when it reads php code.

I like coding in a separate file the mysql code that I need and refer it from there. Would it make a difference if I used stored procedures?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:54:28+00:00Added an answer on May 26, 2026 at 5:54 am

    I recently came upon this problem.

    Using stored procedures on the DB is much faster, when you create the SP it compiles it down into an intermediate code that it can run faster than having to parse standard SQL statements at run time. ALSO the biggest advantage of SP’s is that you can pass in some params, and you can make the SP do a whole load of work on the DB, which can be controlled using IF ELSE statements and CASES, this also keeps traffic between your application and the DB to a minimum.

    One final advantage to SP’s, you can keep the DB implementation seperate from your application implementation, this mean that if say you do an insert in 10 different places in your application, then you change the way the insert needs to be done, you need to go back and change that insert in those 10 different places, whereas if you used an SP to wrap up the insert you can then just change that SP on the fly and the application doesnt need to know 😉

    If your already scripting out your SQL code, then your practically 75% home on writing SP’s

    EDIT: If you use the PHP MySQLi, you may or may not be aware that calling stored procedures returns 2 rowsets as opposed to standard queries that only return 1, but this isn’t too bigger problem as long as you know its coming 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hopefully a picture is worth a thousand lines of code because I don't want
Is it worth changing my code to be more portable and able to deal
I decided to start studying code from other developers to improve my coding skills.
I have heard that writing (coding) unit tests for your application effectively doubles the
I have recently read Apple's sample code for MVCNetworking written by Apple's Developer Technical
Is it worth learning the convention or is it a bane to readability and
Is it worth designing a system to expect test accounts and products to be
Is it worth it to develop WAP webpage for cellular since now cellular have
Are primitives worth keeping? Should all the deprecated stuff be deleted? Do we need
Is it worth to obfuscate java web application? and why?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.