diff --git a/doc/rbac-performance-analysis.md b/doc/rbac-performance-analysis.md index b3a578b7..0e5fce45 100644 --- a/doc/rbac-performance-analysis.md +++ b/doc/rbac-performance-analysis.md @@ -111,7 +111,23 @@ time gw-importHostingAssets ### Fetch the Query Statistics -And afterward we can query the statistics in PostgreSQL: +And afterward we can query the statistics in PostgreSQL, e.g.: + +```SQL +WITH statements AS ( + SELECT * FROM pg_stat_statements pss +) +SELECT calls, + total_exec_time::int/(60*1000) as total_exec_time_mins, + mean_exec_time::int as mean_exec_time_millis, + query +FROM statements +WHERE calls > 100 AND shared_blks_hit > 0 +ORDER BY total_exec_time_mins DESC +LIMIT 16; +``` + +### Reset the Query Statistics ```SQL SELECT pg_stat_statements_reset();