public static void createIndex() throws Exception {
    QueryService qs = CacheUtils.getQueryService();
    /*
     * Indices share the following percentages: a. countryName: 20% objects b. stateName: 33.33%
     * objects c. districtName: 20% objects d. cityName: 50% objects e. villageName: No index
     */
    // queryService.createIndex("villageName", IndexType.FUNCTIONAL, "v.name", "/Countries c,
    // c.states s,
    // s.districts d, d.cities ct, d.villages v");
    qs.createIndex("cityName", IndexType.FUNCTIONAL, "ct.name",
        SEPARATOR + "Countries c, c.states s, s.districts d, d.cities ct, d.villages v");//
    qs.createIndex("districtName", IndexType.FUNCTIONAL, "d.name",
        SEPARATOR + "Countries c, c.states s, s.districts d, d.cities ct, d.villages v");
    qs.createIndex("stateName", IndexType.FUNCTIONAL, "s.name",
        SEPARATOR + "Countries c, c.states s, s.districts d, d.cities ct, d.villages v");
    qs.createIndex("countryName", IndexType.FUNCTIONAL, "c.name",
        SEPARATOR + "Countries c, c.states s, s.districts d, d.cities ct, d.villages v");

    /* Indices on region1 */
    qs.createIndex("villageName1", IndexType.FUNCTIONAL, "v.name",
        SEPARATOR + "Countries1 c, c.states s, s.districts d, d.cities ct, d.villages v");
    qs.createIndex("cityName1", IndexType.FUNCTIONAL, "ct.name",
        SEPARATOR + "Countries1 c, c.states s, s.districts d, d.cities ct, d.villages v");
    qs.createIndex("countryNameA", IndexType.FUNCTIONAL, "c.name",
        SEPARATOR + "Countries1 c, c.states s, s.districts d, d.cities ct, d.villages v");
    qs.createIndex("countryNameB", IndexType.FUNCTIONAL, "c.name", SEPARATOR + "Countries1 c");

    /* Indices on region2 */
    qs.createIndex("stateName2", IndexType.FUNCTIONAL, "s.name",
        SEPARATOR + "Countries2 c, c.states s, s.districts d, d.cities ct, d.villages v");
    qs.createIndex("cityName2", IndexType.FUNCTIONAL, "ct.name",
        SEPARATOR + "Countries2 c, c.states s, s.districts d, d.cities ct, d.villages v");

    /* Indices on region3 */
    qs.createIndex("districtName3", IndexType.FUNCTIONAL, "d.name",
        SEPARATOR + "Countries3 c, c.states s, s.districts d, d.cities ct, d.villages v");
    qs.createIndex("villageName3", IndexType.FUNCTIONAL, "v.name",
        SEPARATOR + "Countries3 c, c.states s, s.districts d, d.cities ct, d.villages v");
    qs.createIndex("cityName3", IndexType.FUNCTIONAL, "ct.name",
        SEPARATOR + "Countries3 c, c.states s, s.districts d, d.cities ct, d.villages v");

    CacheUtils.log("Indices are created");

  }
Get the performance of Range query in an AND junction.
geode-core/src/performanceTest/java/org/apache/geode/cache/query/BaseLineAndCompareQueryPerfJUnitTest.java