You can already get a 10x improvement just by switching from SQL to LDAP. SQL parsing is expensive and inefficient, even with pre-compiled queries.
Writing indexers is pretty tedious; I personally would use something that has already done this for me. Like OpenLDAP.