Creating Predicate Indexes

Consider a scenario that you want to create predicate indexes on the BirthDate and Gender attributes.

Before you beginTake a backup of the existing IndexerConfig.xml file.
    Procedure
  1. Create a CSV file to add the dates to be used as partitions in a primary index for the BirthDate attribute.
    For example, to index a Date of the Birth field, you can define December 31st for each year from 1900 to 2100 as the partition, separating all the dates of birth into separate years. The sample dob_idx.csv file with the partition values:
    12/31/1900
    12/31/1901
    12/31/1902...
    12/31/2099
    12/31/2100
    
  2. Create a text file to add the Gender attribute values.
    The sample gender_idx.txt file:
    Male
    Female
  3. Place the dob_idx.csv and gender_idx.txt files in the $MQ_COMMON_DIR/standard/samples/DQprocess folder.
    Note: If you have containerized TIBCO® MDM 9.2.0_HF-002, log in to TIBCO MDM and navigate to Tools > Configuration Viewer and upload the dob_idx.csv and gender_idx.txt files into the common/standard/samples/DQprocess folder.

    You can also use the $MQ_HOME location to upload the files.

  4. Navigate to the $MQ_HOME/config folder and open the IndexerConfig.xml file to add the attributes for predicate indexes in an IndexEntity.
    Predicate indexes on the BirthDate attribute with the primary index (primayIndex=true):
    <Attribute>
    <AttributeName>BirthDate</AttributeName>
    <IndexDetails primaryIndex="true">$MQ_COMMON_DIR/standard/samples/DQprocess/dob_idx.csv</IndexDetails>
    </Attribute>
    Predicate indexes on the Gender attribute with the secondary index (primayIndex=false):
    <Attribute>					
    <AttributeName>Gender</AttributeName>
    <IndexDetails primaryIndex="false">$MQ_COMMON_DIR/standard/samples/DQprocess/gender_idx.txt</IndexDetails>
    </Attribute>
    Note: Currently, only the string and date type attributes are supported for indexing.
  5. Save the updated IndexerConfig.xml file.
What to do next Follow these steps to create predicate indexes:
  1. Navigate to $MQ_HOME\bin.
  2. On the command line, run one of the following utilities to start the TIBCO Patterns - Search server.
    netricsServer.bat -startServer
    netricsServer.sh -startServer
  3. Start the TIBCO MDM server.
  4. On the command line, run one of the following utilities to view the list of indexes:
    netricsServer.bat -list
    netricsServer.sh -list
    The indexes are created on the repository that is specified in the IndexerConfig.xml file.

    The sample predicate indexes:

    • For the BirthDate attribute with the primary index:
      Primary,Table:indx_PREDREPO_p0,Field:72562_dob,Num. Partitions:103,Pidx(Kbytes):7102,GIP(Kbytes):7753,Tran State:1,Tran Owner:0
      
    • For the Gender attribute with the secondary index:
      Secondary,Table:indx_PREDREPO_p0,Field:72562_gender,Num. Partitions:6,Pidx(Kbytes):120,GIP(Kbytes):0,Tran State:1,Tran Owner:0
      

    You can reindex the index entities by using the Text Index Migration utility (textIndexMigration.bat or textIndexMigration.sh) located at $MQ_HOME\bin.

    Note: If you have containerized TIBCO® MDM 9.2.0_HF-002, log in to TIBCO MDM and navigate to Tools > Component Overview and click Re-index to index the entities in the TIBCO Patterns - Search server.