Adding Secondary Indexes on JSON Tables
Describes how to add secondary indexes on HPE Data Fabric Database JSON tables.
About this task
You can add secondary indexes using the Control System, or the maprcli table
index commands.
If you are adding an index on a large table, particularly if it contains complex data, you
should consider modifying the mfs.db.parallel.copyregions parameter using the maprcli config save
command. The parameter controls the degree of parallel processing in your HPE Data Fabric
cluster. Increasing parallelism can improve the index build time by optimizing the build's
intermediate copy operation.
Permissions
You need the following permissions to add an index:
readAceon the volumelookupdiron directories in the table pathindexpermpermission on the table
If you created the table in version 6.0 or later, you automatically have
indexperm permission. For tables created before 6.0, even if you are the
owner of the table, you must explicitly add indexperm permission.
See Restrictions on Secondary Indexes for information about other restrictions.
table edit
command to reset the regionsizemb parameter to 512 MB from the default
4 GB value. This prevents a memory overflow during the table replication
operation.Adding Indexes Using the Control System
Procedure
- Log in to the Control System and go to the Indexes tab in the table information page.
- Click Add Index to display the Add Index page.
-
Specify the following settings:
-
Specify the list of indexed fields under FIELDS INDEXED.
TIPTo add more indexed fields, click Add Another and repeat step 4.
-
Specify the names of the included fields under INCLUDED
FIELDS.
For more information, see Covering Indexes.TIPTo add additional included fields, click Add Another and repeat step 5.
- Click Add Index to create the index.
Adding Indexes Using the CLI
About this task
maprcli table index add
-path <path>
-index <index name>
-indexedfields < indexed field names >See table index add for a
description of the complete syntax.