DB2 query optimization for aliased object subtree and one level searches

To retrieve one or subtree level search results faster when using aliased objects, the SQL queries are optimized to use literal values of parent or ancestor respectively.

When Directory server is using aliased objects as part of DIT, then SQL corresponding to single level and subtree scope searches uses parameter markers to bind the values of parent and ancestor eid values. Based on the DIT layout and size, these SQL may have some performance impact. To improve performance, use the environment variable IBMSLAPD_USE_LITERAL_FOR_ALIASEDOBJECTS, which is a configurable option. Use the variable to change the SQL to either use parameter markers or literal values.
  1. When IBMSLAPD_USE_LITERAL_FOR_ALIASEDOBJECTS environment variable is not set (default) or set to FALSE or set to a value other than TRUE:

    Aliased object related SQL use parameter markers.

  2. When IBMSLAPD_USE_LITERAL_FOR_ALIASEDOBJECTS environment variable is set to TRUE:

    Aliased objects related SQL use literal values of PEID and AEID values in Single Level and Subtree scope searches respectively.

You can set the IBMSLAPD_USE_LITERAL_FOR_ALIASEDOBJECTS environment variable by using one of the following approaches:

Using the LDAP client utility
  1. Run ldapmodify command by using the ldif file:

    idsldapmodify -p <port> -D <adminDN> -w <adminPW> -i configupdate.ldif

    where configupdate.ldif contains the following lines:

    
    dn: cn=Front End, cn=configuration
    changetype: modify
    add: ibm-slapdSetEnv
    ibm-slapdSetEnv: IBMSLAPD_USE_LITERAL_FOR_ALIASEDOBJECTS=TRUE
    
  2. Restart the directory server instance
Using the command prompt
  1. Set the environment variable IBMSLAPD_USE_LITERAL_FOR_ALIASEDOBJECTS.

    On AIX and Linux systems (ksh shell):

    export IBMSLAPD_USE_LITERAL_FOR_ALIASEDOBJECTS=TRUE

    On Windows systems:

    set IBMSLAPD_USE_LITERAL_FOR_ALIASEDOBJECTS=TRUE

  2. For the set value of the environment variable to be effective, restart the directory server instance from the same shell where the environment variable is set.