[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4605) backs-sql: speedup when using views

Full_Name: Thomas Reifferscheid
Version: 2.3.24
OS: Linux/2.6.16
URL: http://student.physik.uni-mainz.de/~reiffert/slapd/
Submission from: (NULL) (

Here is what I found out when it's about using views with back-sql

I was playing with back-sql, in detail with mysql when noticing that
searching over two views or more get's *VERY* slow. So I was
looking for an replacement of the setup that can be found in
man back-sql.

I finally came to the result of using just *one* view in my mysql-database.

That gave me a strange error that looks like the follwing
error message of the sql-server log:

SELECT DISTINCT ldap_entries.id,ldap_entries.id,'inetOrgPerson' AS
objectClass,ldap_entries.dn AS dn FROM ldap_entries,ldap_entries WHERE
ldap_entries.id=ldap_entries.keyval AND ldap_entries.oc_map_id=1 AND 9=9 AND

and the errormessage was: ERROR 1066 (42000): Not unique table/alias:
as "FROM ldap_entries,ldap_entries" is not working here.

So I patched servers/slapd/back-sql/search.c and now everything is working
at a useable speed for our MUA's (Thunderbird) that use slapd.

Additional information that can be found at the provided URL:
- slapd.conf
- the patch
- mysql-tables used according to man back-sql
  - ldap_attr_mappings
  - ldap_entry_objclasses
  - the *one* view ldap_entries holding all information

Please feel free to ask back.

Kind regards
Thomas Reifferscheid