Mysql Flexible Server Query Cache

Yanping Sun 120 Reputation points
2023-08-24T15:43:00.7566667+00:00

After I updated the procedure, I found the procedure output variable result for the same input variables did not get updated. I am wondering how to clear query cache for mysql stored procedure.

Does execution plan cache gets cleared everytime the procedure gets updated?

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
986 questions
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,542 Reputation points Microsoft Employee Moderator
    2023-08-29T19:58:32.99+00:00

    @Yanping Sun I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer .

    Issue:

    • how to clear the query cache for a MySQL stored procedure and whether the execution plan cache gets cleared every time the procedure is updated.

    Solution:

    • The user was using v8.0 Later and found out there was a bug in their procedure, so it might not have been related to cache (I was guessing the unchanged result was related to cache). However, Mysql workbench didn't give any error then it suddenly did.

    In case if you need additional information

    The execution plan should be flushed if the stored procedure or the underlying table or view is altered using DDL by design. If you don’t see this, we would recommend to leverage FLUSH TABLES, to explicitly clear the cache. For more details on caching behavior of MySQL, please read the documentation below

     

    MySQL :: MySQL 5.7 Reference Manual :: 8.10.4 Caching of Prepared Statements and Stored Programs

    Regards

    Geetha

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.