Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of profiling in MySQL

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail what is the use of profiling in MySQL. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

The profiling feature has been available since the MySQL5.0 version, which allows you to query the detailed execution plan of a SQL.

1. Enable profiling

Mysql > show variables like'% profil%'

+-+ +

| | Variable_name | Value |

+-+ +

| | have_profiling | YES |

| | profiling | ON |

| | profiling_history_size | 15 |

+-+ +

2. Execute SQL and test

Mysql > select * from xcredit.tb_sync_job_bak

3. View profiles

Mysql > show profiles

+-- +

| | Query_ID | Duration | Query | |

+-- +

| | 1 | 0.00009600 | set global profiling=1 |

| | 2 | 0.00218100 | show variables like'% profil%' |

| | 3 | 0.04091100 | select * from xcredit.tb_sync_job_bak where lid |

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report