Count number of MySQL queries executed on page

后端 未结 7 836
慢半拍i
慢半拍i 2020-12-30 07:05

how would I count the number of sql queries executed on one page load?

I have a similar script to time taken for page to be generated, but not for how many queries h

7条回答
  •  情书的邮戳
    2020-12-30 07:39

    You can get the number of queries ever executed by calling.

    show session status like "Queries";
    

    Call this at the beginning and at the end of page creation, and then you can see how many queries there have been. Don't forget that this command itself is also counted as one.

提交回复
热议问题