ExtendedPathIndex has some features which indicate that it targets arbitrary paths and not only those derived from getPhysicalPath:
- the attribute name to be indexed can be specified
- the index supports
multi_valued.
If so, then the following optimisation is (likely) wrong:
# Avoid using the root set
# as it is common for all objects anyway and add overhead
# There is an assumption about all indexed values having the
# same common base path
if level == 0:
indexpath = [p for p in self.getPhysicalPath() if p]
minlength = min(len(indexpath), len(comps))
# Truncate path to first different element
...
As the comment indicates, the index assumes that all paths have a common base path. In the code above, it is heuristically determined based on getPhysicalPath. However, this is correct only when the paths are derived from getPhysicalPath and are not "arbitrary" paths.
The optimisation should therefore only be applied when the indexed attribute is getPhysicalPath
ExtendedPathIndexhas some features which indicate that it targets arbitrary paths and not only those derived fromgetPhysicalPath:multi_valued.If so, then the following optimisation is (likely) wrong:
As the comment indicates, the index assumes that all paths have a common base path. In the code above, it is heuristically determined based on
getPhysicalPath. However, this is correct only when the paths are derived fromgetPhysicalPathand are not "arbitrary" paths.The optimisation should therefore only be applied when the indexed attribute is
getPhysicalPath