3 ms·
Though stored procs will always execute on the server that is probably already the system bottleneck.
by spfzero 5y ago
Though stored procs will always execute on the server that is probably already the system bottleneck.
- funnybeam 5y agoSending multiple queries from your web server will likely put more load on the database server than using a stored procedure. With either technique you are still pulling all the data you need from the DB but with multiple queries instead of a stored procedure you are usually pulling more data than you need with each query and then dropping any rows or fields you’re not interested in. Together with multiple calls over the network to the DB server and (often) multiple SQL connection setups this is much worse for performance on both the web and database servers
- bigbizisverywyz 5y ago>Sending multiple queries from your web server will likely put more load on the database server than using a stored procedure. Lots of people seem to not realize that db roundtrips are expensive, and should be avoided whenever possible. One of the best illustrations of this I've found is in Transaction Processing book by Jim Gray and Andreas Reuters where they illustrate the relative cost of getting data from CPU vs CPU cache vs RAM vs cross host query.
- JJMcJ 5y agoExcept for open and writing to files, it's about the heaviest action on a backend server.