@Test
  public void testIndexUsageIfOneFieldIndexedAndMoreThanOneUnindexed_Bug38032() throws Exception {

    AttributesFactory af = new AttributesFactory();
    af.setValueConstraint(Portfolio.class);
    RegionAttributes ra = af.createRegionAttributes();
    Region region = CacheUtils.getCache().createRegion("pos", ra);
    for (int i = 0; i < 5; i++) {
      region.put("" + i, new Portfolio(i));
    }
    // As default generation of Portfolio objects
    // The status is active for key =0 & key =2 & key =4
    // The description is XXXX for key =1, key =3
    // Let us make explitly
    // Set createTime as 5 for three Portfolio objects of key =0 & key =1 & key=2;
    // Description as XXXX for key =2 only.

    // Thus out of 4 objects created only 1 object ( key =2 ) will have
    // description = XXXX , status = active & time = 5

    ((Portfolio) region.get("0")).setCreateTime(5);
    ((Portfolio) region.get("1")).setCreateTime(5);
    ((Portfolio) region.get("2")).setCreateTime(5);
    ((Portfolio) region.get("2")).description = "XXXX";
    int numSatisfyingOurCond = 0;
    for (int i = 0; i < 5; i++) {
      Portfolio pf = (Portfolio) region.get("" + i);
      if (pf.description != null && pf.description.equals("XXXX") && pf.getCreateTime() == 5
          && pf.isActive()) {
        ++numSatisfyingOurCond;
      }
    }

    assertEquals(1, numSatisfyingOurCond);
    executeQuery_2(region, true /* chcek referential integrity */);
    region.destroyRegion();
    CacheUtils.closeCache();
    CacheUtils.restartCache();
    af = new AttributesFactory();
    af.setValueConstraint(Portfolio.class);

    PartitionAttributesFactory pfa = new PartitionAttributesFactory();

    pfa.setRedundantCopies(0);
    pfa.setTotalNumBuckets(1);
    af.setPartitionAttributes(pfa.create());
    ra = af.createRegionAttributes();
    region = CacheUtils.getCache().createRegion("pos", ra);


    for (int i = 0; i < 5; i++) {
      region.put("" + i, new Portfolio(i));
    }
    // As default generation of Portfolio objects
    // The status is active for key =0 & key =2 & key =4
    // The description is XXXX for key =1, key =3
    // Let us make explitly
    // Set createTime as 5 for three Portfolio objects of key =0 & key =1 & key=2;
    // Description as XXXX for key =2 only.

    // Thus out of 4 objects created only 1 object ( key =2 ) will have
    // description = XXXX , status = active & time = 5

    Portfolio x = (Portfolio) region.get("0");
    x.setCreateTime(5);
    region.put("0", x);
    x = (Portfolio) region.get("1");
    x.setCreateTime(5);
    region.put("1", x);
    x = (Portfolio) region.get("2");
    x.setCreateTime(5);
    x.description = "XXXX";
    region.put("2", x);
    numSatisfyingOurCond = 0;
    for (int i = 0; i < 5; i++) {
      Portfolio pf = (Portfolio) region.get("" + i);
      if (pf.description != null && pf.description.equals("XXXX") && pf.getCreateTime() == 5
          && pf.isActive()) {
        ++numSatisfyingOurCond;
      }
    }

    assertEquals(1, numSatisfyingOurCond);
    executeQuery_2(region, false/* chcek referential integrity */);
    region.destroyRegion();

  }
BugTest for Bug # 38032 Test index usage on PR region & Local region if the where clause
contains three conditions but only one condition is indexed & the total number of from clause
iterators is 1.
geode-core/src/integrationTest/java/org/apache/geode/cache/query/functional/IndexWithSngleFrmAndMultCondQryJUnitTest.java