I recently got asked do you know what a stored procedure is. Erm, it’s a SQL query that’s instantly executed and is therefore faster than adhoc queries. Yes, but why is it faster… Ooo, errr, most likely cached, coz someone once told me it was… not a very good answer at all.

Turns out they are fast for a number of reasons, the best one I found was validation. Other benefits include reduced network traffic and can help against SQL injection.

http://stackoverflow.com/questions/208976/are-stored-procedures-faster-for-simple-queries

Advertisements