Skip to content

Make indices work nicely with/under query modules (QM API) #3068

@gitbuda

Description

@gitbuda

It got very complicated since we added the concurrent index creation because it needs complex ordering of storage access modes (from read-only to read). There are a few options on a high level:

  1. add storage modes and index management to the QM API (maybe not possible, @Ignition to explain)
  2. completely remove the index management from QM API (e.g. schema.assert) but then we have to provide equivalent semantics under CREATE INDEX/CONSTRAINTS.
  3. use the unique access under query modules, in other words, not supporting concurrent index creation

QM should be able to leverage indexes during the execution (that's additional effort, separate/child issue).

Additional Info

Creating and dropping indices using MGP API is used for schema.assert and that's why it isn't documented. We concluded that keeping schema.assert makes sense. Its incompatible with concurrent index creation, but we just kept it the same as before (takes unique access, so not concurrent).

The only issue is if you try to use those index API functions outside of schema.assert, memgraph will go 💥 (crash). We'll add a check so that doesn't happen, and the function fails. The reason that happens is because schema.assert is hardcoded to take unique access (inside interpreter) and you can't do that manually inside API.

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