@Test
  public void testSingleFilterWithSingleEquijoinLimit() throws Exception {
    // In this test we are hoping the index being used will properly use the limit while taking into
    // consideration the filters of c.id and c.pkid
    // This test is set up so that if the pkid index is used and limit applied, if id is not taken
    // into consideration until later stages, it will lead to incorrect results (0)
    createRegions();

    String[] queries = new String[] {
        "select * from " + SEPARATOR + "region1 c, " + SEPARATOR
            + "region2 s where c.id = 3 and c.pkid > 2  and c.pkid = s.pkid limit 1",};

    for (int i = 0; i < 1000; i++) {
      region1.put(i, new Customer(i, i % 10));
      region2.put(i, new Customer(i, i));
    }

    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
      Index secondaryIndex;

      @Override
      public void createIndexForRegion1(int indexTypeId)
          throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
        secondaryIndex = qs.createIndex("region1 id", "p.id", SEPARATOR + "region1 p");
        super.createIndexForRegion1(indexTypeId);
      }

      @Override
      public void destroyIndexForRegion1(int indexTypeId) {
        qs.removeIndex(secondaryIndex);
        super.destroyIndexForRegion1(indexTypeId);
      }

    }, true);
  }
We do not want to test this with Primary Key on the many side or else only 1 result will be
returned
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/EquiJoinIntegrationTest.java