phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: Turn off optimization preventing data roundtrip for UPSERT SELECT and DELETE when transactional
Date Wed, 11 Mar 2015 23:59:25 GMT
Repository: phoenix
Updated Branches:
  refs/heads/txn 52c1d4550 -> 3d9c786ed


Turn off optimization preventing data roundtrip for UPSERT SELECT and DELETE when transactional


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3d9c786e
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3d9c786e
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3d9c786e

Branch: refs/heads/txn
Commit: 3d9c786edd115a37de6f027016f460159ef2fe33
Parents: 52c1d45
Author: James Taylor <jtaylor@salesforce.com>
Authored: Wed Mar 11 16:59:26 2015 -0700
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Wed Mar 11 16:59:26 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/compile/DeleteCompiler.java | 4 +++-
 .../src/main/java/org/apache/phoenix/compile/UpsertCompiler.java | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3d9c786e/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
index 322d24a..b15bfd8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
@@ -303,7 +303,9 @@ public class DeleteCompiler {
                 immutableIndex = getNonDisabledImmutableIndexes(tableRefToBe);
                 boolean mayHaveImmutableIndexes = !immutableIndex.isEmpty();
                 noQueryReqd = !hasLimit;
-                runOnServer = isAutoCommit && noQueryReqd;
+                // Can't run on same server for transactional data, as we need the row keys
for the data
+                // that is being upserted for conflict detection purposes.
+                runOnServer = isAutoCommit && noQueryReqd && !table.isTransactional();
                 HintNode hint = delete.getHint();
                 if (runOnServer && !delete.getHint().hasHint(Hint.USE_INDEX_OVER_DATA_TABLE))
{
                     hint = HintNode.create(hint, Hint.USE_DATA_OVER_INDEX_TABLE);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3d9c786e/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
index 8a76564..2a02b41 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
@@ -404,7 +404,9 @@ public class UpsertCompiler {
                         parallelIteratorFactoryToBe = new UpsertingParallelIteratorFactory(connection,
tableRefToBe);
                         // If we're in the else, then it's not an aggregate, distinct, limted,
or sequence using query,
                         // so we might be able to run it entirely on the server side.
-                        runOnServer = sameTable && isAutoCommit && !(table.isImmutableRows()
&& !table.getIndexes().isEmpty());
+                        // Can't run on same server for transactional data, as we need the
row keys for the data
+                        // that is being upserted for conflict detection purposes.
+                        runOnServer = sameTable && isAutoCommit && !table.isTransactional()
&& !(table.isImmutableRows() && !table.getIndexes().isEmpty());
                     }
                     // If we may be able to run on the server, add a hint that favors using
the data table
                     // if all else is equal.


Mime
View raw message