Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • For a query that will return 1 out of N items, the current time complexity is linear, O(N).
  • For a query that will return all N items, the current time complexity is quadratic, O(N2).


OperationExisting solutionProposed solution
Query 1 out of NO(N)O(1)
Query all out of NO(N2)O(N)

Implementation Proposal

The new approach involves adding a column to the Fragment table, storing the last path component (called xpath_component here). The new column is indexed, to allow constant-time lookups.

...