Why are queries executed from mysql workbench taking much longer than executing them directly from the mysql cli?

后端 未结 1 1559
粉色の甜心
粉色の甜心 2021-01-20 15:37

I have a query that does multiple joins on several tables and uses a covering index. It seems to run a lot faster when executed directly from the mysql cli instead of from

1条回答
  •  有刺的猬
    2021-01-20 16:08

    There's a persistent connection in Workbench, so there's no overhead in that regard. Executing a query should be equally fast in both CLI as well as Workbench, however data transfer is a bit slower sometimes because Workbench locally caches results first to be able to sort over it when the user clicks a header field in the resultset view (including multi column sort). Try repeating the query in both tools and see if the times still differ. The first run of a query is usually slower than following runs due to the execution cache.

    0 讨论(0)
提交回复
热议问题