FAQ: How to monitor Index creation progress?

Index creation in Postgress may take quite a long time to be created, be aware that some constraints will require an index.

In order to verify if the process creating the index is waiting or running at at what stage of ro the process is, the following views can be queried:

  • pg_stat_activity: Verify tha the wait_event and wait_event_type are null, if there are any waiting even refer to the documentation to identify what is causing it. A query like this would help to identify the PID and current running query too:

    • select pid, wait_event, wait_event_type, query from pg_stat_activity
  • pg_stat_progress_create_index: This view will show the phase the process creating the index is at, the documentation includes a table describing the create index phases.

3 Likes