Search code examples
mysqlstored-proceduresdatabase-performancesqlperformance

using stored procedures or queries


I am working on a JEE project. The client wants me to put all the SELECT requests in stored procedures instead of using SELECT * from table - style queries.

In the Java file, he wants to use Call findall() - style queries to MySQL.

Is there is a difference between the two methods considering the running time and the largest database.


Solution

  • In MySQL there is very little performance difference between queries in stored procedures and the same queries issued directly from a Java (or other) program.

    (Some other makes of RDMS servers compile their stored procedures and so can get some optimizations from them. But MySQL is simple.)

    You can move your queries to stored procedures without worrying about performance.