mysql stored procedure is slower 20 times than standard query

前端 未结 4 357
梦谈多话
梦谈多话 2020-12-16 13:33

i have 10 tables with same structure except table name.

i have a sp (stored procedure) defined as following:

 select * from table1 where (@param1 IS          


        
4条回答
  •  萌比男神i
    2020-12-16 14:04

    Interesting question, because I am fond of using stored procedures. Reason is maintenance and the encapsulation principle.

    This is information I found: http://dev.mysql.com/doc/refman/5.1/en/query-cache-operation.html

    It states that the query cache is not used for queries that 1. are a subquery that belong to an outer query, and 2. are executed within the body of a stored procedure, trigger or event.

    This implies that it works as designed.

提交回复
热议问题