为什么MySQL存储过程、函数和触发器对性能不好
As we can see, func3 (with four dead code calls that will never be executed, otherwise identical to func1) runs almost 3x slower compared to func1(); func3_nope() is identical in terms of response time to func3(). Visualizing All System Calls From FunctionsTo figure out what is happening inside the function calls, I used performance_schema/sys schema to create a trace with ps_trace_thread() procedure. 1.Get the thread_id for the MySQL connection:
2.Run ps_trace_thread in another connection passing the thread_id=49:
3.At that point I switched to the original connection (thread_id=49) and run:
(编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |