原文:.net core 下监控Sql的执行语句 最近在编写.net core程序,因为数据库从Sql Server 切换到 MySql的原因,无法直接查看sql的具体语句,随着业务量的剧增,痛苦也与日俱增,为了彻底解决该问题,我在github.stackoverflow等站点不断搜索,试图找到一个好的办法. 搜索的结果大都是这样的: SHOW VARIABLES LIKE "general_log%"; SET GLOBAL general_log = 'ON'; 好嘞,试过以后发现
SELECT procpid, START, now() - START AS lap, current_query FROM ( SELECT backendid, pg_stat_get_backend_pid (S.backendid) AS procpid, pg_stat_get_backend_activity_start (S.backendid) AS START, pg_stat_get_backend_activity (S.backendid) AS current_que