Using the Index Advisor v8

Index Advisor is distributed with EDB Postgres Advanced Server version 9.0 and later. Index Advisor works with SQL Profiler by examining collected SQL statements and making indexing recommendations for any underlying tables to improve SQL response time. Index Advisor works on all DML (INSERT, UPDATE, DELETE) and SELECT statements that are invoked by a superuser.

Diagnostic output from the Index Advisor includes:

  • Forecasted performance benefits from any recommended indexes
  • The predicted size of any recommended indexes
  • DDL statements you can use to create the recommended indexes

Before using Index Advisor, you must:

  1. Modify the postgresql.conf file on each EDB Postgres Advanced Server host, adding the index_advisor library to the shared_preload_libraries parameter.

  2. Install the Index Advisor contrib module. To install the module, use the psql client or PEM Query tool to connect to the database, and invoke the following command:

    \i <complete_path>/share/contrib/index_advisor.sql

  3. Restart the server to make your changes to take effect.

Index Advisor can make indexing recommendations based on trace data captured by SQL Profiler. To open Index Advisor, select one or more queries in the SQL Profiler Trace Data pane and select Index Advisor from the toolbar. For more information about configuring and using Index Advisor, see EDB Postgres Advanced Server.

Note

Index Advisor can't analyze statements invoked by a non-superuser. If you attempt to analyze statements invoked by a non-superuser, the server log includes the following error:

ERROR: access to library "index_advisor" is not allowed 

Note

We recommend that you disable Index Advisor while using the pg_dump functionality.