Optimization
You must optimize the database and update the table statistics to improve query performance and to reduce data retrieval time.
You must optimize the database periodically or after database updates. For example, after you import entries into a directory server instance. You can optimize the database by using the idsrunstats command or from the Optimize database panel of IBM® Security Verify Directory Configuration Tool. The tool internally calls the idsrunstats command to update database statistics that is used by the query optimizer for all the LDAP tables.
You can run the idsrunstats command to update the DB2 system catalog statistics. The statistics include the physical characteristics of tables and associated indexes in the database of a directory server instance. The physical characteristics of a table include number of records, number of pages, and average record length. To collect database statistics, the following parameters, DB2RUNSTATS_ALL_COLUMNS|DB2RUNSTATS_ALL_INDEXES, are passed to the db2Runstats API. You can run the idsrunstats command against a directory server instance even when the instance is up and running.
idsrunstats Tool is enhanced to have configurable value for num_freqvalues to boost the performance. This value can be configured by using IDSRUNSTATS_NUM_FREQVALUES environment variable. Refer DB2 selectivity for more details.
To optimize the database, run the following command:
idsrunstats –I instance_name
The instance_name variable is the directory server instance name and is an optional parameter. If your computer contains more that one instance, you must specify the instance name.
After you complete the optimization, you might require to restart the directory server if you do not see performance benefits after you flush the package cache.
To know more about the usage of the idsrunstats command, see IBM Security Verify Directory Command Reference.