[Rt-commit] rt branch, 4.0/fts-indexer-performance, created. rt-4.0.7-58-g0893aa4

Thomas Sibley trs at bestpractical.com
Wed Sep 12 17:13:44 EDT 2012


The branch, 4.0/fts-indexer-performance has been created
        at  0893aa44277aea51741adc208aeb366f4ef1e993 (commit)

- Log -----------------------------------------------------------------
commit 0893aa44277aea51741adc208aeb366f4ef1e993
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Sep 12 14:11:30 2012 -0700

    FTS indexer: Joins are already distinct, avoid the perf hit of doing so again
    
    On DBIx::SearchBuilder > 1.62, indicate that the joins won't produce
    duplicates, avoiding the DISTINCT massaging that happens otherwise.
    This drastically improves performance when fetching attachments for
    indexing.

diff --git a/sbin/rt-fulltext-indexer.in b/sbin/rt-fulltext-indexer.in
index 7e31cac..06aa892 100644
--- a/sbin/rt-fulltext-indexer.in
+++ b/sbin/rt-fulltext-indexer.in
@@ -217,6 +217,11 @@ sub attachments {
         VALUE => 'deleted'
     );
 
+    # On newer DBIx::SearchBuilder's, indicate that making the query DISTINCT
+    # is unnecessary because the joins won't produce duplicates.  This
+    # drastically improves performance when fetching attachments.
+    $res->{joins_are_distinct} = 1;
+
     return goto_specific(
         suffix => $type,
         error => "Don't know how to find $type attachments",

-----------------------------------------------------------------------


More information about the Rt-commit mailing list