IBM Support

LDAP_MAXCARD and IBMSLAPD_USE_SELECTIVITY behavior in Directory Server

Question & Answer


Question

The following summarizes the behavior of the LDAP_MAXCARD and IBMSLAPD_USE_SELECTIVITY environment variables in Directory Server

Answer

LDAP_MAXCARD is an environment variable which can indirectly force the cardinality of the LDAP_DESC table (LDAP descendent table that keeps track of ancestor and descendent relations) to be very high (9E18) so that DB2 will attempt to resolve all other attribute filters before looking at the LDAP_DESC table to resolve "sub tree" relationships. Internally, LDAP_MAXCARD instigates the ldap server to call a function called rdbm_tune_stats. This function enables the cardinality of the LDAP_DESC table to be increased.

  • LDAP_MAXCARD can be either set to YES, ONCE or NO, or it might not be set.

IBMSLAPD_USE_SELECTIVITY is an environment variable which can be used to make directory server to use DB2 selectivity on SQLs related to "sub tree" searches. This is introduced in Version 6.2.

  • IBMSLAPD_USE_SELECTIVITY can be either set to YES or NO, or it might not be set.
 

Behavior of various versions of Directory Server with respect to above mentioned variables:

1. Versions 8.0.1, 6.4 and 6.3.1:


  • i. Default behavior - LDAP_MAXCARD or IBMSLAPD_USE_SELECTIVITY are NOT set:

    • With Directory Server versions 6.3.1/6.4/8.0.1, by default (when the variables LDAP_MAXCARD or IBMSLAPD_USE_SELECTIVITY are NOT set), the "sub tree" or "single level" search related SQLs will use literal values of ancestor or parent respectively, instead of a parameterized variables. This in turn will make DB2 optimizer to improve the "sub tree" and "single level" search performance in all scenarios.

      When using 6.3.1/6.4/8.0.1 its highly recommended to use this default behavior.

      Note: If you have custom scripts to perform "db2 runstats" on Directory Server's database, make sure not to inflate the CARD values for LDAP_DESC and LDAP_ENTRY tables.


    ii. When LDAP_MAXCARD and/or IBMSLAPD_USE_SELECTIVITY env variables are used, Version 6.3.1 will show the following behavior:

    • LDAP_MAXCARD = YES | ONCE | NO
      1. If LDAP_MAXCARD is set to YES, DB2's cardinality statistic for the LDAP_DESC table is set to an inflated value of 9E18. This setting of the cardinality is done at server startup and every minute thereafter.
      2. If LDAP_MAXCARD is set to ONCE, then the cardinality is set once during each server startup but not subsequently while the server is running.
      3. If LDAP_MAXCARD is set to NO, then the cardinality statistic is not changed.

      IBMSLAPD_USE_SELECTIVITY = NO | YES
      1. If IBMSLAPD_USE_SELECTIVITY is not set or set to NO, then selectivity is not used to influence DB2's access plans.
      2. If IBMSLAPD_USE_SELECTIVITY is set to YES and LDAP_MAXCARD is either not set or set to NO, then selectivity is used to influence DB2's decisions about accessing data during large "sub tree" searches. The use of selectivity is explained further in the knowledge center.

      Note: If LDAP_MAXCARD is set to YES and IBMDSLAPD_USE_SELECTIVITY is set to YES, the server will log a message and SELECTIVITY will not be used.

2. Versions 6.2 and 6.3 will show the following behavior:

  • LDAP_MAXCARD = YES | ONCE | NO
    1. If LDAP_MAXCARD is set to YES or by default, if neither environment variable is set, DB2's cardinality statistic for the LDAP_DESC table is set to an inflated value of 9E18. This setting of the cardinality is done at server startup and every minute thereafter.
    2. If LDAP_MAXCARD is set to ONCE, then the cardinality is set once during each server startup but not subsequently while the server is running.
    3. If LDAP_MAXCARD is set to NO, then the cardinality statistic is not changed.

    IBMSLAPD_USE_SELECTIVITY = NO | YES
    1. If IBMSLAPD_USE_SELECTIVITY is not set or set to NO, then selectivity is not used to influence DB2's access plans.
    2. If IBMSLAPD_USE_SELECTIVITY is set to YES and LDAP_MAXCARD is not set to YES, then selectivity is used to influence DB2's decisions about accessing data during large "sub tree" searches. The use of selectivity is explained further in the knowledge center.

    Note: If LDAP_MAXCARD is set to YES and IBMDSLAPD_USE_SELECTIVITY is set to YES, the server will not use SELECTIVITY and also log a message that SELECTIVITY will not be used.

3. Versions 6.0 and 6.1 will show the following behavior:

    1. If LDAP_MAXCARD is not set, then the cardinality is set once during each server startup but not subsequently while the server is running.
    2. If LDAP_MAXCARD is set to YES, then the cardinality is set during each server startup and every minute thereafter.
    3. If LDAP_MAXCARD is set to NO, then the cardinality statistic is not changed.

4. Version 5.2 with a build level at or greater than 040806 (with APAR IR54069 fix in patch P520x-01B or later) will show the following behavior:

    1. If LDAP_MAXCARD is not set, then the cardinality statistic is not changed.
    2. If LDAP_MAXCARD is set to YES, the cardinality is set during each server startup and every minute thereafter.
    3. If LDAP_MAXCARD is set to NO, then the cardinality statistic is not changed.

5. Version 5.1 or 5.2 with a build level less than 040806 (before patch P520x-01B) will show the following behavior:

    1. If LDAP_MAXCARD is not set, then it will default to YES, the cardinality is set during each server startup and every minute thereafter.
    2. If LDAP_MAXCARD is set to YES, the cardinality is set during each server startup and every minute thereafter.
    3. If LDAP_MAXCARD is set to NO, then the cardinality statistic is not changed.

  • Note: As a strong recommendation, LDAP_MAXCARD should be set to "NO" for fix levels less than 5.2 FP3 (APAR IO00241 fixed in 5.2 FP3 or later) or the server may hang due to a deadlock.

[{"Product":{"code":"SSVJJU","label":"IBM Security Directory Server"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"5.2;6.0;6.1;6.2;6.3;6.3.1;6.4;8.0.1","Edition":"","Line of Business":{"code":"LOB24","label":"Security Software"}}]

Document Information

Modified date:
01 October 2019

UID

swg21316267