Manage Indexes

      +
      You can perform some index management tasks using the Couchbase Capella UI.

      Accessing Indexes in the Capella UI

      Permissions Required

      To access indexes in the Couchbase Capella UI, you need the following permissions:

      To view the Indexes page for a database that’s running the Index Service:

      1. With the Projects tab in your organization open, click the project with the database you’re working with.

      2. With the Databases tab open, select your database.

      3. Click the Data Tools tab.

      4. In the navigation menu, click Indexes.

      Index Summary

      The Indexes page summarizes all indexes on the database in a tabular format. It includes sortable columns and a row for each index.

      Each index has the following information:

      Index Name

      The name of the index or replica.

      Status

      The current state of the Index Service on the node where this index is stored. The possible statuses include ready, pause, or warmup.

      Requests/sec

      The number of requests per second.

      Resident Ratio

      The percentage of the data held in memory.

      Items

      The number of items indexed.

      Data Size

      The size of indexable data that’s maintained for the index or replica.

      Bucket

      The bucket for which the index or replica was created.

      Scope

      The scope for which the index or replica was created.

      Collection

      The collection for which the index or replica was created.

      Each index has a Trash icon at the end of its row, which you can use to drop the associated index.

      Create an Index

      Indexes are created using the SQL++ query language. The Query Workbench can create, modify, and drop indexes using SQL++ statements.

      Inspect an Index

      • To view the details of an index, select its name on the Indexes page.

        This action opens the index fly-out menu:

      An index’s individual fly-out menu.

      At the top of the fly-out menu is the Index Definition section. This section displays the SQL++ statement used to define the index. Directly below it is a snippet of the information from the index list.

      Open the Index Definition

      • Click Open in Workbench to open the index definition in the Query Workbench.

        The index definition is added to the Query Editor.

      The defining and editing of indexes is performed using the SQL++ query language. Using the Query Editor, you can modify the index definition as required to create a new index. You can’t change the definition of the existing index, but you can create a new index with the modified definition and then drop the old index.

      The Query Workbench showing the index definition displayed in the Query Editor.

      View Index Performance

      The Bucket’s Index Performance section displays statistics for the Index Service and the specific bucket the current index is defined for.

      The following statistics apply to the Index Service as a whole:

      Index Service RAM Quota

      The buffer cache size for the Index Service across all nodes.

      RAM Used/Remaining

      The amount of memory used by the Index Service, and the remaining amount of memory available to the Index Service.

      Index Service RAM Percent

      The amount of memory used by the Index Service, as a percentage of the amount of memory available to the Index Service.

      The following statistics apply to the specific bucket that the current index is defined for:

      Index Data Size

      The actual data size consumed by all indexes for the selected bucket.

      Index Fragmentation

      The percentage fragmentation of all indexes for the selected bucket. This indicates the percentage of disk space consumed by the indexes, but not utilized for items stored in the indexes.

      Indexes Disk Size

      The total disk file size consumed by all indexes for the selected bucket.

      Total Scan Rate

      The number of index items scanned by the Index Service per second for the selected bucket.

      Drop an Index

      1. On the Indexes page, find the index you wish to drop and click the Trash icon at the end of its row.

      2. When prompted to confirm the deletion, click Confirm to drop the index.

      You can also drop an index using the SQL++ DROP INDEX or DROP PRIMARY INDEX commands.