Skip to content

Instantly share code, notes, and snippets.

View mschout's full-sized avatar

Michael Schout mschout

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mschout on github.
  • I am mschout (https://keybase.io/mschout) on keybase.
  • I have a public key whose fingerprint is E5A2 42DB 0A8C 8009 3D33 C742 A425 DBB5 A433 5D1A

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am mschout on github.
  • I am mschout (https://keybase.io/mschout) on keybase.
  • I have a public key ASBS1Kc9DVPQrbttmgHhyJMnpJ8h51gJnPhpbredER_0oQo

To claim this, I am signing this object:

@mschout
mschout / gist:338043
Created March 19, 2010 18:55
Find useless postgresql indexes
-- find useless indexes in PostgreSQL 8.3
-- find indexes scanned less than 200 times.
-- adjust idstat.idx_scan to change this number
--
-- flush the stats with pg_stat_reset() if you want to start over.
-- adapted from http://it.toolbox.com/blogs/database-soup/finding-useless-indexes-28796
SELECT
idstat.schemaname AS schema_name,
idstat.relname AS table_name,
indexrelname AS index_name,
package Template::Plugin::Singleton::PerTemplate;
use strict;
use base qw(Template::Plugin);
my $Instance;
sub new {
my ($class, $context) = @_;