Skip to main content
Glama
isdaniel

PostgreSQL-Performance-Tuner-Mcp

get_active_queries

Monitor active PostgreSQL queries to identify long-running operations, detect lock contention, and analyze query patterns for performance optimization.

Instructions

Get information about currently active queries and connections.

Note: By default, this tool excludes system/background processes and focuses on client backend queries to help you analyze your application's query patterns. System catalog queries are filtered out unless explicitly requested.

Shows:

  • All active queries and their duration

  • Idle transactions that may be holding locks

  • Blocked queries waiting for locks

  • Connection state breakdown

Useful for:

  • Identifying long-running queries

  • Finding queries that might need optimization

  • Detecting stuck transactions

  • Troubleshooting lock contention

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_duration_secondsNoMinimum query duration in seconds to include
include_idleNoInclude idle connections
include_systemNoInclude system/background processes
databaseNoFilter by specific database

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/isdaniel/pgtuner-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server