Open
Description
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
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);
}
Metadata
Metadata
Assignees
Labels
No labels
Activity