5.12. Indexes #
This section explains how to manage indexes. It contains the following instructions:
Creating an Index
In the navigation panel, go to Databases.
(Optional) To display system databases, turn on Show system databases.
Click the name of the database.
Click the name of the schema.
Click the name of the table.
In the top-right corner of the page, click Create index.
Enter parameters of the new index (parameters marked with an asterisk are required):
Name.
Concurrently building: Specifies whether the index will be created in a special mode that minimizes the number of locks and reduces the risk of their occurrence when there are concurrent workloads.
Unique index: Specifies whether to control duplicate table values when creating the index and adding new values to it.
Columns: Columns that will be included in the index.
To add a column:
Click Add column +.
Enter parameters of the new column (parameters marked with an asterisk are required):
Column: The name of the column.
Operator class: The operators that will be used by the index for the column.
Collation: The collation for the column.
Order: The sorting order for the column.
Possible values:
Default
Ascending
Descending
NULL's order: The sorting order of the
NULLvalues.Possible values:
Default
NULL first
NULL last
The Operator class, Collation, Order, and NULL's order parameters are available only if you turn on Extended settings.
(Optional) In the top-right corner of the window, turn on Extended settings and specify additional parameters:
Tablespace: The tablespace where the index will be located.
Using method: The access method.
Possible values:
btree
gin
gist
brin
hash
Where predicate: The condition of the index.
lock_timeout, s: Abort any statement that waits longer than the specified time while attempting to acquire a lock on a table, index, row, or other database object. The time limit applies separately to each lock acquisition attempt.
For more information about this parameter, refer to the official Postgres Pro documentation.
Click Create.
Viewing Indexes
In the navigation panel, go to Databases.
(Optional) To display system databases, turn on Show system databases.
Click the name of the database.
Click the name of the schema.
Click the name of the table.
Select Indexes.
The table of indexes with the following columns will be displayed:
Indexes: The unique name of the index.
Total size.
CFS: Specifies whether the CFS compression is used for the index.
Status.
Possible values:
valid: The standard state in which the index can be used in queries.
invalid: The index cannot be used in queries. This status indicates that the index is being created or was damaged.
Actions.
For more information about available actions, refer to other instructions in this section.
Important
If an index is created outside PPEM, the information about it can be displayed in the web application with a delay. The delay duration depends on the agent configuration. By default, it is one minute.
Reindexing an Index
The REINDEX SQL command is executed when reindexing.
To reindex an index:
In the navigation panel, go to Databases.
(Optional) To display system databases, turn on Show system databases.
Click the name of the database.
Click the name of the schema.
Click the name of the table.
Select Indexes.
Click Reindex next to the index.
Specify the reindexing parameters (parameters marked with an asterisk are required):
Concurrently: Specifies whether the operation will be performed in the non-locking mode. This is the safest mode that allows avoiding locking other sessions by slowing down the process of reindexing.
Possible values:
On
Off
Tablespace: The tablespace where the index will be reindexed.
Click Execute.
The reindexing task will start.
Note
Depending on the number and size of indexes, this operation may require significant resources so it is recommended to track it.
Editing an Index
In the navigation panel, go to Databases.
(Optional) To display system databases, turn on Show system databases.
Click the name of the database.
Click the name of the schema.
Click the name of the table.
Select Indexes.
Click
next to the index. Edit index parameters.
Click Save.
Deleting an Index
Important
Deleted indexes cannot be restored.
To delete an index:
In the navigation panel, go to Databases.
(Optional) To display system databases, turn on Show system databases.
Click the name of the database.
Click the name of the schema.
Click the name of the table.
Select Indexes.
Click
next to the index. Click Delete.