You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2012/11/05 18:46:07 UTC

git commit: add index scan predicate to tracing output

Updated Branches:
  refs/heads/trunk f04bebfa7 -> 8782c366a


add index scan predicate to tracing output


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8782c366
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8782c366
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8782c366

Branch: refs/heads/trunk
Commit: 8782c366a4075a3556070ab1da448eef8a6ef79a
Parents: f04bebf
Author: Jonathan Ellis <jb...@apache.org>
Authored: Mon Nov 5 11:32:07 2012 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Mon Nov 5 11:45:55 2012 -0600

----------------------------------------------------------------------
 .../db/index/composites/CompositesSearcher.java    |    6 +++++-
 .../cassandra/db/index/keys/KeysSearcher.java      |    6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8782c366/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
index caf375b..d5a2611 100644
--- a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
@@ -95,6 +95,10 @@ public class CompositesSearcher extends SecondaryIndexSearcher
         assert index != null;
         final DecoratedKey indexKey = index.getIndexKeyFor(primary.value);
 
+        if (logger.isDebugEnabled())
+            logger.debug("Most-selective indexed predicate is {}",
+                         ((AbstractSimplePerColumnSecondaryIndex) index).expressionString(primary));
+
         /*
          * XXX: If the range requested is a token range, we'll have to start at the beginning (and stop at the end) of
          * the indexed row unfortunately (which will be inefficient), because we have not way to intuit the small
@@ -209,7 +213,7 @@ public class CompositesSearcher extends SecondaryIndexSearcher
                             return makeReturn(currentKey, data);
                         }
 
-                        if (logger.isTraceEnabled() && (index instanceof AbstractSimplePerColumnSecondaryIndex))
+                        if (logger.isTraceEnabled())
                             logger.trace("Scanning index {} starting with {}",
                                          ((AbstractSimplePerColumnSecondaryIndex)index).expressionString(primary), indexComparator.getString(startPrefix));
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8782c366/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java b/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
index bb03672..a07f773 100644
--- a/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
@@ -89,11 +89,13 @@ public class KeysSearcher extends SecondaryIndexSearcher
         // TODO: allow merge join instead of just one index + loop
         final IndexExpression primary = highestSelectivityPredicate(filter.getClause());
         final SecondaryIndex index = indexManager.getIndexForColumn(primary.column_name);
-        if (logger.isDebugEnabled())
-            logger.debug("Most-selective indexed predicate is on {}", baseCfs.getComparator().getString(primary.column_name));
         assert index != null;
         final DecoratedKey indexKey = index.getIndexKeyFor(primary.value);
 
+        if (logger.isDebugEnabled())
+            logger.debug("Most-selective indexed predicate is {}",
+                         ((AbstractSimplePerColumnSecondaryIndex) index).expressionString(primary));
+
         /*
          * XXX: If the range requested is a token range, we'll have to start at the beginning (and stop at the end) of
          * the indexed row unfortunately (which will be inefficient), because we have not way to intuit the small