summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-05-28 16:11:45 +1000
committerAndrew Tridgell <tridge@samba.org>2009-05-28 16:11:45 +1000
commit47692f39b1b3b5c589bfb63a6968aaf9f9af70c4 (patch)
tree265c5f74274482733ad79c7a37ceed6a4406bc40
parent0a0d760704ad17f5f43ffc1782ad4d84f75de5a2 (diff)
downloadsamba-47692f39b1b3b5c589bfb63a6968aaf9f9af70c4.tar.gz
samba-47692f39b1b3b5c589bfb63a6968aaf9f9af70c4.tar.bz2
samba-47692f39b1b3b5c589bfb63a6968aaf9f9af70c4.zip
a useful debugging tool
When looking at performance problems with ldb it can be useful to see which searches causes unindexed full searches. This makes it easy to enable that.
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index d395c28f28..b307c5fb2f 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -546,6 +546,13 @@ int ltdb_search(struct ltdb_context *ctx)
* callback error */
if ( ! ctx->request_terminated && ret != LDB_SUCCESS) {
/* Not indexed, so we need to do a full scan */
+#if 0
+ /* useful for debugging when slow performance
+ * is caused by unindexed searches */
+ char *expression = ldb_filter_from_tree(ctx, ctx->tree);
+ printf("FULL SEARCH: %s\n", expression);
+ talloc_free(expression);
+#endif
ret = ltdb_search_full(ctx);
if (ret != LDB_SUCCESS) {
ldb_set_errstring(ldb, "Indexed and full searches both failed!\n");