@Override
public void applyIndexes( QueryContext context,
IndexCostCalculator calculator ) {
for (javax.jcr.query.qom.Constraint constraint : calculator.andedConstraints()) {
if (constraint instanceof SameNode) {
SameNode sameNode = (SameNode)constraint;
String path = sameNode.getPath();
calculator.addIndex(NODE_BY_PATH_INDEX_NAME, null, null, singletonList(constraint), 1, 1L, -1.0f,
PATH_PARAMETER, path);
} else if (constraint instanceof ChildNode) {
ChildNode childNode = (ChildNode)constraint;
String path = childNode.getParentPath();