From what I understand Drupal 6 doesn't because it doesn't use PHP5's mysqli extension, and stored procedures are only suppported through mysqli.

I have personally not run any benchmark that supports that the use of stored procedures is more efficient. However, I am pretty sure I read somewhere in MySQL's documentation that stored procedures, new in MySQL 5.x, are a faster alternative to doing the traditional queries from PHP because

  • Less data is passed from the web server to the DBMS
  • MySQL 5 comes with a mechanism for "caching" those stored procedures

Without taking other things into consideration, it does makes sense to support them because even when Drupal has it's caching mechanism, it sure loves to do a lot of queries for tasks like generating a category/taxonomy page.

Comments

confiq’s picture

After almost 3 year, this question stands.
Whats drupal opinion about MySQL store procedure ? Schema API does not support it (as I'm aware of) and Drupal 6 has MySqli extention now where you can write your own store procedure.

But the question is, is it really necessarily to write store procedure with 2 queries in it?