diff --git a/ldapdb/backends/ldap/compiler.py b/ldapdb/backends/ldap/compiler.py
index <HASH>..<HASH> 100644
--- a/ldapdb/backends/ldap/compiler.py
+++ b/ldapdb/backends/ldap/compiler.py
@@ -228,6 +228,17 @@ class SQLCompiler(object):
             yield row
             pos += 1
 
+    def has_results(self):
+        import inspect
+        iterator = self.results_iter()
+        if inspect.isgenerator(iterator):
+            try:
+                obj = iterator.next()
+                return True
+            except:
+                return False
+        else:
+            return False
 
 class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):
     pass
-Add: has_results support.

.exists now calls .has_results() ,as such, we process results_iter() and
return if there is at least one item. (We thern do not process the rest
of the items).