Skip to main content

Index Management

Indexes are a key technique for improving database query performance. By creating indexes on frequently queried fields, you can significantly improve query speed and user experience.

How to Create Indexes

  1. Go to the CloudBase Console / PostgreSQL Database.
  2. Select the target environment and database table, then open Index Management.
  3. Click Create Index.
  4. Enter the index name, then select the index type, columns, and sort direction.
  5. Confirm the configuration and submit it. Wait until the index creation is complete.

The console is suitable for creating common single-column indexes, multi-column indexes, and unique indexes. For advanced cases such as expression indexes, partial indexes, and concurrent index creation, use SQL statements instead.

PostgreSQL Index Types

PostgreSQL provides a variety of index types suitable for different query scenarios:

Index TypeDescriptionUse Cases
B-treeDefault index type, supports equality and range queriesMost common query scenarios: =, <, >, BETWEEN, ORDER BY, etc.
HashHash index, supports equality queries onlyExact match scenarios only
GINGeneralized Inverted IndexJSONB field queries, array containment queries, full-text search
GiSTGeneralized Search TreeGeometric data, full-text search, range types, nearest-neighbor queries
BRINBlock Range IndexLarge sequential data tables (e.g., time-series data), very small storage footprint
tip

For detailed explanations and creation syntax for each index type, refer to the PostgreSQL Official Documentation - Indexes.