Skip to content

Introduce in predicate to check against a set of values #213

Open
@maydanw

Description

@maydanw

Problem to Solve

Concrete example:
Given a list of 1000s of document entities ids retrieved from a search in ES we want to check if a user has access to each of them and filter them.
The current options are either:

  1. Running 1000s of independent queries
  2. Build a query with 1000s of independent OR statements

Both are inefficient

Current Workaround

  1. Running 1000s of independent queries
  2. Build a query with 1000s of independent OR statements

Proposed Solution

Add "in" (or "isIn") construct to the syntax
For example (in python):

query = "match $d isa document, has objID in ["123", "1122", "333AAA", "6A5B"]; ..."

Additional Information

Beyond improving the ease of usage, I (@maydanw) believe this can be optimized due to:

  • Server caching - from my understanding lots of the reasoner caching is only inside the tx,
  • Same server snapshot
  • It can have better server CPUs utilization
  • Less network communication
  • Validating the predicate value in the list can be hashed instead of searched for each.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions