[
https://issues.apache.org/jira/browse/GEODE-8287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17143998#comment-17143998
]
ASF GitHub Bot commented on GEODE-8287:
---------------------------------------
nabarunnag commented on a change in pull request #5279:
URL: https://github.com/apache/geode/pull/5279#discussion_r445014814
##########
File path:
geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/IndexUsageInJoinQueryDistributedTest.java
##########
@@ -0,0 +1,209 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
+ * or implied. See the License for the specific language governing permissions
and limitations under
+ * the License.
+ */
+package org.apache.geode.cache.query.dunit;
+
+import static org.apache.geode.cache.RegionShortcut.REPLICATE;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientRegionShortcut;
+import org.apache.geode.cache.query.IndexExistsException;
+import org.apache.geode.cache.query.IndexNameConflictException;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.RegionNotFoundException;
+import org.apache.geode.distributed.internal.DistributionStats;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.pdx.PdxReader;
+import org.apache.geode.pdx.PdxSerializable;
+import org.apache.geode.pdx.PdxWriter;
+import org.apache.geode.test.dunit.rules.ClientVM;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.categories.OQLIndexTest;
+import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
+
+@Category({OQLIndexTest.class})
+public class IndexUsageInJoinQueryDistributedTest implements Serializable {
+
+ private MemberVM locator;
+
+ private MemberVM server;
+
+ private ClientVM client;
+
+ private static final String PRODUCT_REGION_NAME = "product";
+
+ private static final String INSTRUMENT_REGION_NAME = "instrument";
+
+ @Rule
+ public ClusterStartupRule clusterRule = new ClusterStartupRule();
+
+ @Rule
+ public SerializableTestName testName = new SerializableTestName();
+
+ @Test
+ public void testSecondIndexUsedWhenExecutingJoinQuery() throws Exception {
+ // Start Locator
+ locator = clusterRule.startLocatorVM(0);
+
+ // Start server
+ server = clusterRule.startServerVM(1, locator.getPort());
+
+ // Create server regions
+ server.invoke(() -> createServerRegionsAndIndexes());
+
+ // Start client
+ client = clusterRule.startClientVM(2, c ->
c.withLocatorConnection(locator.getPort()));
+
+ // Create client regions
+ client.invoke(() -> createClientRegions());
+
+ // Load regions
+ int numProducts = 1000, numInstruments = 100;
Review comment:
There was some discussion on the dev channel to avoid single line
multiple variable declarations. Maybe, can split it up
```suggestion
int numProducts = 1000;
int numInstruments = 100;
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> QueryUtils doNestedIterationsForIndex is not applying an index value
> correctly and causing the entire region to be iterated
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: GEODE-8287
> URL: https://issues.apache.org/jira/browse/GEODE-8287
> Project: Geode
> Issue Type: Bug
> Components: querying
> Affects Versions: 1.12.0
> Reporter: Barrett Oglesby
> Assignee: Barrett Oglesby
> Priority: Major
> Labels: caching-applications
>
> Here is an example of the query in 8.2.12:
> {noformat}
> Query Executed in 3.502438E7 ms; indexesUsed(2):mapFieldIndex(Results:
> 500),pkIdIndex(Results: 1) "select vr1, vr2 from /region1 vr1, /region2 vr2
> where vr1.id = vr2.id and vr1.mapField['FIELDNAME']=$1"
> {noformat}
> The number of DistributionStats deserializations is 1,001.
> Here is an example of the query in 9.10.0:
> {noformat}
> Query Executed in 22732.467 ms; rowCount = 500;
> indexesUsed(2):mapFieldIndex(Results: 500),pkIdIndex(Results: 1) "select vr1,
> vr2 from /region1 vr1, /region2 vr2 where vr1.id = vr2.id and
> vr1.mapField['FIELDNAME']=$1"
> {noformat}
> The number of DistributionStats deserializations is 25,001,004
--
This message was sent by Atlassian Jira
(v8.3.4#803005)