PostgreSQL Indexes Test

An index is a data structure that a database uses to reduce the amount of time it takes to perform certain operations. An index can also be used to ensure that duplicate values don’t appear where they are not needed.

This test monitors the indexes on the PostgreSQL server and helps administrators quickly and accurately assess the effectiveness of these indexes.

Target of the test : PostgreSQL server

Agent deploying the test: An internal/remote agent

Outputs of the test : One set of results for every index for every table in each database that is configured for monitoring on the target PostgreSQL server

Configurable parameters for the test
  1. TEST PERIOD – How often should the test be executed.
  2. Host – The IP address of the server.
  3. Port – The port on which the server is listening. The default port is 5432.
  4. User – In order to monitor a PostgreSQL server, you need to manually create a special database user account in every PostgreSQL database instance that requires monitoring. When doing so, ensure that this user is vested with the superuser privileges. The sample script we recommend for user creation for eG monitoring is:


    ENCRYPTED PASSWORD {‘eguser password’}


    The name of this user has to be specified in the USERNAME text box.

  5. Password- The password associated with the above user name (can be ‘NULL’). Here, ‘NULL’ means that the user does not have any password.
  6. Confirm password – Confirm the password (if any) by retyping it here.
  7. dbname - The name of the database to connect to. The default is “postgres”.
  8. include db - Specify a comma-separated list of databases that you wish to monitor.
  9. exclude db - Specify a comma-separated list of databases that need to be excluded from monitoring. By default, this is set to rdsadmin.



    If you are monitoring a PostgreSQL server on the AWS EC2 cloud, then make sure that you do not remove 'rdsadmin' from the EXCLUDE DB list.


  10. ssl - The name of this user has to be specified in the USERNAME text box.
Measurements made by the test
Measurement Description Measurement Unit Interpretation

Index scans:

Indicates the rate at which the index scans are initiated on this index in this database .



Rows read:

Indicates the rate at which the index entries (rows) are read during the index scans on this index.



Rows fetched:

Indicates the rate at which the rows are fetched from this index upon execution of a query.


If the value of this measure is greater than the value of the Rows read measure, it indicates a possibility of index fragmentation or that the executed query is inefficient.