tkobayas opened a new issue, #6228:
URL: https://github.com/apache/incubator-kie-drools/issues/6228

   When a constraint is like `age >= 0 && age < 20`, executable-model doesn't 
split the constraint into two constraints, so it doesn't enable range index. It 
only affects the performance (it's enabled when more than 9 alpha nodes for the 
same field by default), not the rule behaviour.
   
   `age >= 0, age < 20` doesn't have this issue.
   
   AlphaNodeRangeIndexingTest
   ```java
       public void testSurroundingRange(KieBaseTestConfiguration 
kieBaseTestConfiguration) {
           final String drl =
                   "package org.drools.compiler.test\n" +
                              "import " + Person.class.getCanonicalName() + 
"\n" +
                              "rule test1\n when\n" +
                              "   Person( age >= 0 && age < 20 )\n" +
                              "then\n end\n" +
                              "rule test2\n when\n" +
                              "   Person( age >= 20 && age < 40 )\n" +
                              "then\n end\n" +
                              "rule test3\n when\n" +
                              "   Person( age >= 40 && age < 60 )\n" +
                              "then\n end\n";
   
           final KieBase kbase = 
createKieBaseWithRangeIndexThresholdValue(kieBaseTestConfiguration, drl, 3);
           final KieSession ksession = kbase.newKieSession();
   
           assertSinks(kieBaseTestConfiguration, kbase, Person.class, 3, 3, 0, 
3);
   
           ksession.insert(new Person("John", 18));
           int fired = ksession.fireAllRules();
           assertThat(fired).isEqualTo(1);
   
           ksession.insert(new Person("Paul", 60));
           fired = ksession.fireAllRules();
           assertThat(fired).isEqualTo(0);
       }
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to