-
Notifications
You must be signed in to change notification settings - Fork 166
Description
- Build apoc.schema.assert mage#409
- Extend schema.assert to all index types #2462
- https://memgraph.com/docs/querying/schema#assert
- https://memgraph.com/docs/fundamentals/storage-access
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:
- add storage modes and index management to the QM API (maybe not possible, @Ignition to explain)
- completely remove the index management from QM API (e.g.
schema.assert
) but then we have to provide equivalent semantics underCREATE INDEX/CONSTRAINTS
. - 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.