Обсуждение: Index Advice in PG

Поиск
Список
Период
Сортировка

Index Advice in PG

От
Jony Cohen
Дата:
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: 
Or directly from GitHub:

Regards,
 - Jony