Index Advice in PG

From: Jony Cohen <jony(dot)cohenjo(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Index Advice in PG
Date: 2015-06-17 19:10:46
Message-ID: CAD9xk1-Cba6iS0Bm_mvrm33qQ38+rmc7sk3eamUnrFM-PXuFhA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi list,
I am happy to announce the new release of pg_idx_advisor version 0.1.2.
This is a PostgreSQL extension which allows a user to get index advice from
the DB optimizer.

It's the first "stable" release so please don't go running this on your
production environment :)
But, I'd greatly appreciate any comments/thoughts/issues/pull requests...

It's fairly simple to use:
1. # create extension pg_idx_advisor;
2. # load '$libdir/plugins/pg_idx_advisor.so';
and then run explain on the queries you'd like to get advice on:
3. # explain select * from t where a = 100;INFO:
** Plan with original indexes **

QUERY PLAN
--------------------------------------------------------------------------------
Seq Scan on t (cost=0.00..36.75 rows=11 width=8)
Filter: (a = 100)

** Plan with hypothetical indexes **
read only, advice, index: create index on t(a)
Bitmap Heap Scan on t (cost=4.12..14.79 rows=11 width=8)
Recheck Cond: (a = 100)
-> Bitmap Index Scan on <V-Index>:114699 (cost=0.00..4.11 rows=11
width=0)
Index Cond: (a = 100)
(9 rows)

You can get it from the postgres extension network:
http://pgxn.org/dist/pg_idx_advisor
Or directly from GitHub:
https://github.com/cohenjo/pg_idx_advisor

Regards,
- Jony

Browse pgsql-general by date

  From Date Subject
Next Message William Dunn 2015-06-17 19:14:27 pg_class.reltuples VS pg_stat_all_tables.n_live_tup for estimation of table
Previous Message Tom Lane 2015-06-17 16:06:24 Re: pg_dump 8.4.9 failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux