4.16 Optimizing the ODBC Driver Performance

Following are the few optimization methods suggested when using the ODBC driver for eDirectory. Using the following SQL sample query, you can make use one or more of these methods to improve the ODBC driver performance.

 SELECT "_GroupNDS"."CN", "_UserNDS"."CN", "_UserNDS"."employeeStatus", "_OU"."OU" FROM   "_GroupNDS" "_GroupNDS", "_OU" _OU", "_UserNDS" "_UserNDS" WHERE  ("_GroupNDS"."NDS_Context"="_OU"."NDS_FullName") AND ("_GroupNDS"."Member"="_UserNDS"."Group Membership") AND "_GroupNDS"."CN"='FP2111' ORDER BY "_GroupNDS"."CN"
 

Method 1: Use one more static comparison in the query. In the above query, "_GroupNDS"."CN"='FP2111' implies a static comparison which makes the query perform faster than a query without it. We recommend you to use the static comparison for attributes which have unique value. For example, CN.

Method 2: Use static comparison in the largest table selected. For example, if you are reading from User and OU and if the number of Users are larger than OU, use the static comparison in the User. This considerably reduces the time taken for search.

Method 3: Order the tables with the slowest spin in the left, when selecting the table in the from clause. For example, from the previous query, order the tables in the following sequence:

 SELECT "_GroupNDS"."CN", "_UserNDS"."CN", "_UserNDS"."employeeStatus","_OU"."OU" FROM "_UserNDS","_OU","_GroupNDS"