Skip to content

Instantly share code, notes, and snippets.

View cympfh's full-sized avatar
🏠
Working from home

/c/ympfh cympfh

🏠
Working from home
View GitHub Profile
@matsuu
matsuu / slow_query.sql
Last active November 23, 2023 13:07
performance_schemaを使用したスロークエリー抽出
-- ORDER BYとLIMITは必要応じて適宜修正
-- VIEWを作成すると便利
SELECT
count_star AS cnt,
sum_timer_wait/1e12 AS sum,
min_timer_wait/1e12 AS min,
avg_timer_wait/1e12 AS avg,
max_timer_wait/1e12 AS max,
sum_rows_sent AS sumRows,
sum_rows_sent/count_star AS avgRows,