lib/pghero/methods/query_stats.rb in pghero-3.0.1 vs lib/pghero/methods/query_stats.rb in pghero-3.1.0
- old
+ new
@@ -224,10 +224,11 @@
pg_database.datname = #{database ? quote(database) : "current_database()"}
#{query_hash ? "AND queryid = #{quote(query_hash)}" : nil}
)
SELECT
query,
+ query AS explainable_query,
query_hash,
query_stats.user,
total_minutes,
average_time,
calls,
@@ -241,10 +242,10 @@
SQL
# we may be able to skip query_columns
# in more recent versions of Postgres
# as pg_stat_statements should be already normalized
- select_all(query, query_columns: [:query])
+ select_all(query, query_columns: [:query, :explainable_query])
else
raise NotEnabled, "Query stats not enabled"
end
end