Skip to content

Conversation

colinbarry
Copy link
Contributor

@colinbarry colinbarry commented Jun 3, 2025

Queries using a label+property index now correctly return matching results when comparing properties against regular expressions.

The problem was caused by index code rejecting ranges across different PropertyTypes as being invalid. This is true in most cases, (e.g. WHERE node.a > 'hello' AND node.a < 42) but not in the case where the upper-bound is an exclusive (<) bound on the next (from an ordering standpoint) PropertyType. As the exclusive upper bound exclusive sentinel is not compared against, it means that the range is still across a single PropertyType.

Regexes uses a range that is inclusively lower bounded on the empty string, and exclusively upper bounded on the minimum value of whatever PropertyType happens to follow string.

(This bug was a regression introduced by composite indices.)

#Fixes 3010

@colinbarry
Copy link
Contributor Author

colinbarry commented Jun 3, 2025

Tracking

  • [Link to Epic/Issue]

Standard development

CI Testing Labels

  • Select the appropriate CI test labels (CI -build=build-name -test=test-suite)

Documentation checklist

  • Add the documentation label
  • Add the bug / feature label
  • Add the milestone for which this feature is intended
    • If not known, set for a later milestone
  • Write a release note, including added/changed clauses
    • Queries using regex clauses on label+property indices no longer return an empty results set. Users can now use label+property indices to improve performance of regex queries (although note that, unlike exact text match queries, regex queries require an additional filtering step.) #3025
@colinbarry colinbarry self-assigned this Jun 3, 2025
@colinbarry colinbarry added the bug bug label Jun 3, 2025
@colinbarry colinbarry added this to the mg-v3.4.0 milestone Jun 3, 2025
@colinbarry colinbarry linked an issue Jun 3, 2025 that may be closed by this pull request
@colinbarry colinbarry added CI -build=jepsen -test=core Run jepsen build and core tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push CI -build=release -test=stress Run release build and stress tests on push Docs - changelog only Docs - changelog only labels Jun 3, 2025
@colinbarry colinbarry force-pushed the fix/label-property-regex-support branch from 0fee8c2 to 616e656 Compare June 11, 2025 10:44
@colinbarry colinbarry requested a review from DavIvek June 11, 2025 10:48
@colinbarry colinbarry marked this pull request as ready for review June 11, 2025 13:08
@colinbarry colinbarry added this pull request to the merge queue Jun 12, 2025
Merged via the queue into master with commit 0d66a63 Jun 12, 2025
17 checks passed
@colinbarry colinbarry deleted the fix/label-property-regex-support branch June 12, 2025 10:04
@gitbuda gitbuda mentioned this pull request Jul 7, 2025
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug bug CI -build=jepsen -test=core Run jepsen build and core tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push CI -build=release -test=stress Run release build and stress tests on push Docs - changelog only Docs - changelog only

2 participants