Manage Indexes

    +
    You can perform certain index management tasks through the Couchbase Cloud UI.

    Accessing Indexes in the Couchbase Cloud UI

    If a cluster is running the Index Service, indexes can be accessed under the cluster’s Tools > Indexes tab. An index list, showing a summary of all indexes, is displayed in table format.

    The cluster’s 'Tools > Indexes' tab.
    Database Permissions Required

    In order to access indexes in the Couchbase Cloud UI, you must have a database user associated with your organization user account. Without a database user, the Tools > Indexes tab will display a message saying that you don’t have the proper permissions to access indexes.

    Only indexes on buckets for which the database user has Read/Write permissions will appear in the Tools > Indexes tab.

    Index Summary

    A cluster’s Tools > Indexes tab shows a summary of all the indexes on the cluster. The summary is displayed in table format, with sortable columns and a row for each index.

    The index list displays the following information about each index:

    Index Name

    The name of the index or replica.

    Status

    The current state of the Index Service on the node on which this index is stored: 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 currently indexed.

    Data Size

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

    Bucket

    The bucket for which the index or replica was created.

    A Trash icon is displayed at the end of each row, which can be used to drop the index.

    Create an Index

    Indexes are created by means of the N1QL query language. The Query Workbench can be used to do things like create, modify, and drop indexes using N1QL statements.

    Inspect an Existing Index

    To work with an index, begin by finding it in the index summary and clicking on its row. This opens the index’s fly-out menu:

    An index’s individual fly-out menu.

    At the top of the fly-out menu, the Index Definition section displays the N1QL 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 loaded into the Query Editor. From here you can modify the index definition as required in order to create a new index. (You cannot change the definition of the existing index, but you can create a new index with the modified definition.)

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

    The defining and editing of indexes is performed by means of the N1QL query language. The Query Workbench can be used to do things like create, modify, and drop indexes using N1QL statements.

    View Index Performance

    The Bucket’s Index Performance section displays statistics for the Index Service as a whole, as well as the specific bucket that 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. From the cluster’s Tools > Indexes tab, find the index you wish to drop and click on the Trash icon at the end of the index’s row.

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

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

    Modify Index Settings

    Clicking Index Settings opens the Index Settings fly-out menu, which contains multiple settings for configuring the Index Service.

    The 'Index Settings' fly-out menu.

    The following settings are available:

    Indexer Threads

    The number of dedicated threads used by the Index Service. The number can be increased on multi-core machines. The default is 0.

    Log Level

    Adjust the logging level. The options are: Silent, Fatal, Error, Warn, Info, Verbose, Timing, Debug, and Trace. The default is Info.

    Click Save to save any modifications to the settings.