PyForge is sold only here, on the official py-forge.com website — beware of imitations.

Back to the catalog

QuerySentry CLI

#python#cli#postgresql#mysql#performance

Find slow queries and missing indexes before they take your app down.

$49 Commercial License
Or get every tool, current and future, for $99 with the All-Access Pass

After payment you get an email with your download link within a few minutes. The link is valid for 7 days.

Digital goods. If a tool doesn't work as described, we fix it or refund you — see Terms.

Not sure? Try the free MockForge sample first.

Key features

  • monitor shows running queries live; slow ranks statements by total time
  • indexes suggests indexes with ready-to-run DDL
  • kill cancels long queries only with --execute; pool warns near the connection limit

requirements.txt — no third-party packages needed

What's in the ZIP

  • README.md — up and running in under a minute
  • querysentry.py — complete, readable source code
  • requirements.txt — no third-party packages needed
  • test_querysentry.py — test suite included

Why PyForge: Ready-made tools with full source code.

More details

Find slow queries and missing indexes before they take your app down. QuerySentry works with PostgreSQL and MySQL/MariaDB. - monitor shows running queries live; slow ranks statements by total time - indexes suggests indexes with ready-to-run DDL - kill cancels long queries only with --execute; pool warns near the connection limit Runs with: Python 3, zero dependencies (drives the psql or mysql client). Slow-query analysis needs pg_stat_statements or performance_schema.

QuerySentry CLIDatabases
Read the technical deep-diveDitching $300/mo Database SaaS: Field Notes on QuerySentry CLI
querysentry.pybashExample usage — querysentry.py
# Try every command on sample data
python querysentry.py indexes --demo

export QUERYSENTRY_DB_URI="postgres://user:pass@localhost:5432/app"
python querysentry.py monitor
python querysentry.py slow --limit 10
python querysentry.py kill --threshold 300            # dry run
python querysentry.py kill --threshold 300 --execute

Quick Start

Runs on Python 3.9 or newer with the standard library only. Nothing to pip install.

1 — Run it

python querysentry.py --help

How agents & programs use it: It uses only the Python standard library, so scripts and AI agents can run it as a subprocess without extra installs.

Why developers buy from PyForge

  • Save hours: ready-made, tested tools. Skip writing, debugging and maintaining it yourself.
  • Ready in minutes: one file, drop it in your project and run it.
  • Mostly zero-dependency: no pip install chains, no supply-chain risk.
  • Full source code: readable, auditable, yours to modify.
  • Runs locally and offline: no account, no API key, no data leaves your machine.
  • Pay once, own it: no subscription.
  • Tested before release: every tool is checked before it goes on sale.

All-Access Pass

Get every PyForge tool with the All-Access Pass

48 tools today plus every future release, lifetime commercial license, one payment of $99.

This tool: $49 · All 48 tools: $99

See the All-Access Pass