[Checkins] SVN: Products.ZCatalog/trunk/ Added reporting of the intersection time of each index' result with the result set of the other indexes and consider this time to be part of each index time for prioritizing the index.

Hanno Schlichting hannosch at hannosch.eu
Sun Apr 10 12:03:53 EDT 2011


Log message for revision 121370:
  Added reporting of the intersection time of each index' result with the result set of the other indexes and consider this time to be part of each index time for prioritizing the index.
  

Changed:
  U   Products.ZCatalog/trunk/CHANGES.txt
  U   Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py
  U   Products.ZCatalog/trunk/src/Products/ZCatalog/dtml/catalogReport.dtml
  U   Products.ZCatalog/trunk/src/Products/ZCatalog/plan.py

-=-
Modified: Products.ZCatalog/trunk/CHANGES.txt
===================================================================
--- Products.ZCatalog/trunk/CHANGES.txt	2011-04-10 15:43:34 UTC (rev 121369)
+++ Products.ZCatalog/trunk/CHANGES.txt	2011-04-10 16:03:52 UTC (rev 121370)
@@ -4,6 +4,10 @@
 2.13.10 (unreleased)
 --------------------
 
+- Added reporting of the intersection time of each index' result with the
+  result set of the other indexes and consider this time to be part of each
+  index time for prioritizing the index.
+
 - Removed tracking of result length from the query plan. The calculation of the
   length of an intermediate index result can itself be expensive.
 

Modified: Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py
===================================================================
--- Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py	2011-04-10 15:43:34 UTC (rev 121369)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py	2011-04-10 16:03:52 UTC (rev 121370)
@@ -549,8 +549,15 @@
                     cr.stop_split(i, result=None, limit=limit_result)
                     return LazyCat([])
 
+                # provide detailed info about the pure intersection time
+                intersect_id = i + '#intersection'
+                cr.start_split(intersect_id)
+                w, rs = weightedIntersection(rs, r)
+                cr.stop_split(intersect_id)
+
+                # consider the time it takes to intersect the index result with
+                # the total resultset to be part of the index time
                 cr.stop_split(i, result=r, limit=limit_result)
-                w, rs = weightedIntersection(rs, r)
                 if not rs:
                     break
             else:

Modified: Products.ZCatalog/trunk/src/Products/ZCatalog/dtml/catalogReport.dtml
===================================================================
--- Products.ZCatalog/trunk/src/Products/ZCatalog/dtml/catalogReport.dtml	2011-04-10 15:43:34 UTC (rev 121369)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/dtml/catalogReport.dtml	2011-04-10 16:03:52 UTC (rev 121370)
@@ -2,8 +2,12 @@
 <dtml-var manage_tabs>
 
 <p class="form-help"> 
-   The <strong>query report</strong> shows catalog queries that
-   perform slowly.
+   The <strong>query report</strong> shows catalog queries that perform slowly.
+   For each index there's an additional entry for the time the intersection of
+   the index result with the result by the other indexes took. These are marked
+   with a <i>#intersection</i> postfix. The time reported for the index is the
+   sum of the intersection time and the time the index itself took. Subtract
+   the intersection time, if you want to know the pure index time.
 </p>
 
 <table width="100%" cellspacing="0" cellpadding="2" border="0">

Modified: Products.ZCatalog/trunk/src/Products/ZCatalog/plan.py
===================================================================
--- Products.ZCatalog/trunk/src/Products/ZCatalog/plan.py	2011-04-10 15:43:34 UTC (rev 121369)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/plan.py	2011-04-10 16:03:52 UTC (rev 121370)
@@ -244,7 +244,7 @@
         # sort indexes on (limited result index, mean search time)
         # skip internal ('#') bookkeeping records
         ranking = [((value.limit, value.duration), name)
-                   for name, value in benchmark.items()]
+                   for name, value in benchmark.items() if '#' not in name]
         ranking.sort()
         return [r[1] for r in ranking]
 



More information about the checkins mailing list