Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add indexing properties on relationships, a.k.a. edge indexes #662

Open
jhb opened this issue Nov 23, 2022 · 8 comments · May be fixed by #1964
Open

Add indexing properties on relationships, a.k.a. edge indexes #662

jhb opened this issue Nov 23, 2022 · 8 comments · May be fixed by #1964
Assignees
Labels
customer customer Effort - High Effort - High feature feature Frequency - Daily Frequency - Daily non-incremental Priority - Now Priority - Now Reach - Most Reach - Most Severity - S1 Severity - S1
Milestone

Comments

@jhb
Copy link

jhb commented Nov 23, 2022

According to https://memgraph.com/docs/memgraph/reference-guide/indexing it is possible to create indexes on node properties, but no such functionality exists for edges.

IMHO there are a lot of use cases where import properties are put on edges - sometimes the edge properties are even more relevant than the node properties. E.g. I would like to find all edges that carry a certain date, or are within a range (if modeled with a start and end property). Or edges that carry a certain source of origin, and so on.

While surely the graph could be remodeled with edges as "connection nodes", making this a necessity is not really desirable for graph modeling, and somewhat defeats the purpose of graph databases. Also, competitors have this feature, and migrating data towards memgraph would then require remodeling the whole graph.

IMPORTANT:

  • an option is to add node id to each edge -> very memory inefficient at least 16B more for each edge
  • another option is to embed vertex IDs inside the index itself -> no memory penalty if the index is not used

PRs:

@gitbuda gitbuda added the feature feature label Nov 30, 2022
@gitbuda gitbuda self-assigned this Nov 30, 2022
@gitbuda
Copy link
Member

gitbuda commented Dec 5, 2022

Hi @jhb!

Definitely a helpful feature :) I/we would consider adding it in the short run, but since we are doing a significant rearchitecting of the Memgraph (project-pineapples branch), features like this are not a priority at the moment. Once we are done with the groundwork, we'll get back 😄

That being said, one alternative that doesn't require remodeling the whole graph is to store some form of node identifier on the edge (on the application side). If nodes are indexed based on the identifier, once you have an edge, it's possible to query the edge fast because you can access it via node. In other words, having the index on the app side. I know it might not be the perfect solution. Is that feasible in your case?

@jhb
Copy link
Author

jhb commented Dec 5, 2022

Hi Marko, thanks a lot for your feedback, and of course for your work on memgraph in the first place.

I am looking at different use cases at the moment. For my personal usecase, a generic graph editor (for knowlege management etc.) workarounds in the form of extra nodes that are indexed on behalf of edges might be doable. Those nodes become a bit of a hassle though because they need filtering in the app in all kinds of places - I guess indexing edges outside memgraph would be easier in that case (using a repository layer in front of the graph).

For other use cases (graph analysis etc.) I would imagine the workarounds to become quite cumbersome, because there is not app to carry the extra logic most of the time, and those extra nodes might spoil the experience of interacting directly with the graph.

Having said all this - there is no urgency, and I am looking forward to seeing what changes the pineapples will bring.

Cheers J

@Josipmrden
Copy link
Contributor

Added task to the backlog, although it's not a high priority, we can see what can we do about it at this point.

@antejavor antejavor added the Importance - I2 Importance - I2 label Jun 7, 2023
@gitbuda gitbuda changed the title Feature: indexing properties on relationships, a.k.a. relationship indexes Add indexing properties on relationships, a.k.a. relationship indexes Sep 19, 2023
@gitbuda gitbuda added this to the mg-v2.13.0 milestone Oct 12, 2023
@gitbuda gitbuda added the community community label Oct 12, 2023
@gitbuda gitbuda removed their assignment Oct 13, 2023
@gitbuda gitbuda removed the Importance - I2 Importance - I2 label Oct 13, 2023
@gitbuda gitbuda changed the title Add indexing properties on relationships, a.k.a. relationship indexes Add indexing properties on relationships, a.k.a. edge indexes or vertex-centric indexes Oct 17, 2023
@gitbuda
Copy link
Member

gitbuda commented Oct 17, 2023

+1 request for this feature

@katarinasupe katarinasupe added Importance - I3 Importance - I3 Effort - Unknown Effort - Unknown Severity - S3 Severity - S3 labels Dec 5, 2023
@gitbuda gitbuda modified the milestones: mg-v2.13.0, experiment Dec 6, 2023
@DavIvek DavIvek added Effort - Very High Effort - Very High and removed Effort - Unknown Effort - Unknown labels Dec 18, 2023
@karmenrabar
Copy link

+1 from the community

@Joy-Panda
Copy link

+1 request for this feature

1 similar comment
@ronx-labs
Copy link

+1 request for this feature

@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later and removed Priority - Later Priority - Later labels Feb 4, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later and removed Priority - Later Priority - Later labels Feb 18, 2024
@gitbuda
Copy link
Member

gitbuda commented Feb 26, 2024

+1 here

@gitbuda gitbuda added customer customer and removed community community labels Feb 26, 2024
@katarinasupe katarinasupe added Frequency - Weekly Frequency - Weekly Reach - Some Reach - Some Reach - Most Reach - Most and removed Importance - I3 Importance - I3 Reach - Some Reach - Some labels Feb 27, 2024
@gitbuda gitbuda added Effort - High Effort - High Frequency - Daily Frequency - Daily and removed Effort - Very High Effort - Very High Frequency - Weekly Frequency - Weekly labels Feb 28, 2024
@gitbuda gitbuda added Priority - Next Priority - Next Severity - S1 Severity - S1 and removed Priority - Later Priority - Later Severity - S3 Severity - S3 labels Feb 28, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Now Priority - Now and removed Priority - Next Priority - Next labels Mar 1, 2024
@gitbuda gitbuda modified the milestones: experiment, mg-v2.17.0 Mar 25, 2024
@Josipmrden Josipmrden changed the title Add indexing properties on relationships, a.k.a. edge indexes or vertex-centric indexes Add indexing properties on relationships, a.k.a. edge indexes Mar 26, 2024
@gitbuda gitbuda linked a pull request Apr 22, 2024 that will close this issue
7 tasks
@gitbuda gitbuda modified the milestones: mg-v2.17.0, mg-v2.18.0 May 20, 2024
@antepusic antepusic linked a pull request Jun 3, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer customer Effort - High Effort - High feature feature Frequency - Daily Frequency - Daily non-incremental Priority - Now Priority - Now Reach - Most Reach - Most Severity - S1 Severity - S1
Projects
None yet
Development

Successfully merging a pull request may close this issue.