Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

PgHero: Easy Insights Into Your PostgreSQL Database

DZone's Guide to

PgHero: Easy Insights Into Your PostgreSQL Database

· Java Zone ·
Free Resource

Get the Edge with a Professional Java IDE. 30-day free trial.

If you're working with PostgreSQL and want to get a better a sense of what's going on under the hood in your database, here's something cool: PgHero, created by Andrew Kane on GitHub, offers a variety of insights into running queries, used and unused resources, and things like that. The GitHub page lists the following commands:

PgHero.running_queries
PgHero.long_running_queries
PgHero.index_usage
PgHero.missing_indexes
PgHero.unused_indexes
PgHero.unused_tables
PgHero.database_size
PgHero.relation_sizes
PgHero.index_hit_rate
PgHero.table_hit_rate

# kill queries
PgHero.kill(pid)
PgHero.kill_all

And the end result is something like this:

(Source: PgHero on GitHub)

You'll need PostgreSQL 9.2 or better to run PgHero, and it's definitely still a work in progress - there's a TODO section on the GitHub page, after all - but still worth checking out.


Get the Java IDE that understands code & makes developing enjoyable. Level up your code with IntelliJ IDEA. Download the free trial.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}