Skip to content

Should ExtendedPathIndex be usable for arbitrary paths? #12

Description

@d-maurer

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions