{"version":"1.0","type":"rich","title":"find long running query in postgres","description":"This example displays PostgreSQL processes that have been running for more than five minutes, highlighting long-running queries for database monitoring. It uses a SQL query against `pg_stat_activity` to retrieve process IDs, query text, waiting status, wait reasons, and start times, filtering out idle sessions and ordering by duration. The visualization presents these results as a text-based table or list, with the data sourced directly from the live database system catalog. The code relies on standard PostgreSQL system functions like `now()` and interval comparisons to identify and rank the most time-consuming queries.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-4bdb49366bd884922ca410584997846f?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}