Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 18DF2200D29 for ; Wed, 11 Oct 2017 10:24:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 172C31609CA; Wed, 11 Oct 2017 08:24:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 64615160BE5 for ; Wed, 11 Oct 2017 10:24:51 +0200 (CEST) Received: (qmail 21507 invoked by uid 500); 11 Oct 2017 08:24:50 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 21440 invoked by uid 99); 11 Oct 2017 08:24:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2017 08:24:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B9AEFF5BCF; Wed, 11 Oct 2017 08:24:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Wed, 11 Oct 2017 08:24:52 -0000 Message-Id: In-Reply-To: <4399191001cb4b3c90357bfea40e5975@git.apache.org> References: <4399191001cb4b3c90357bfea40e5975@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/7] ignite git commit: IGNITE-6588: SQL: optimized index segment resolution. This closes #2825. archived-at: Wed, 11 Oct 2017 08:24:52 -0000 IGNITE-6588: SQL: optimized index segment resolution. This closes #2825. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0f3546a9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0f3546a9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0f3546a9 Branch: refs/heads/ignite-3478 Commit: 0f3546a9b45e55181f0c16b11f9378452357b2ec Parents: 4385f12 Author: devozerov Authored: Tue Oct 10 17:54:50 2017 +0300 Committer: devozerov Committed: Tue Oct 10 17:54:50 2017 +0300 ---------------------------------------------------------------------- .../query/h2/opt/GridH2IndexBase.java | 25 +++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/0f3546a9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java index 6568f13..048192a 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java @@ -804,26 +804,23 @@ public abstract class GridH2IndexBase extends BaseIndex { protected int segmentForRow(SearchRow row) { assert row != null; - CacheObject key; - - if (ctx != null) { - final Value keyColValue = row.getValue(KEY_COL); + if (segmentsCount() == 1 || ctx == null) + return 0; - assert keyColValue != null; + CacheObject key; - final Object o = keyColValue.getObject(); + final Value keyColValue = row.getValue(KEY_COL); - if (o instanceof CacheObject) - key = (CacheObject)o; - else - key = ctx.toCacheKeyObject(o); + assert keyColValue != null; - return segmentForPartition(ctx.affinity().partition(key)); - } + final Object o = keyColValue.getObject(); - assert segmentsCount() == 1; + if (o instanceof CacheObject) + key = (CacheObject)o; + else + key = ctx.toCacheKeyObject(o); - return 0; + return segmentForPartition(ctx.affinity().partition(key)); } /**