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

Support composite indexes #2660

Closed
pierreis opened this issue Oct 12, 2018 · 5 comments
Closed

Support composite indexes #2660

pierreis opened this issue Oct 12, 2018 · 5 comments
Labels
area/performance Performance related issues. kind/feature Something completely new we should consider. popular priority/P2 Somehow important but would not block a release. status/accepted We accept to investigate/work on it.

Comments

@pierreis
Copy link

pierreis commented Oct 12, 2018

Unless I missed some key information, it is not possible to create composite indexes in Dgraph. Supporting this feature would help some use-cases requiring filtering on multiple attributes of a tag.

Typical example of such feature would be a versioned graph, in which a node is associated with a name, a version number and some random parameters.
In that case, most queries would be a combination of a name, and a specific version number, range queries or simply the highest version to get fresh data.
With single-attribute indexes, the performance when the number of versions is high is hindered significantly compared to that of i.e. JanusGraph, which has this feature.

@srfrog srfrog added the kind/enhancement Something could be better. label Oct 12, 2018
@manishrjain
Copy link
Contributor

It's not clear what you're looking for. Can you follow the format of an experience report? What is it that you want to do, what did you currently do to achieve it, and why that wasn't ideal?

https://github.com/golang/go/wiki/ExperienceReports

@manishrjain manishrjain added the kind/question Something requiring a response. label Jan 16, 2019
@naivefun
Copy link

@manishrjain I think what @pierreis wants is quite clear, faster query on multi fields.

In dgrqph it is done by connecting multi filters, but I also doubt it's comparable to composite index like this https://stackoverflow.com/questions/795031/how-do-composite-indexes-work

Especially if 90% of your queries are composite index based the performance gap would be a concern I guess.

@srfrog
Copy link
Contributor

srfrog commented Mar 18, 2019

We don't support composite indexes right now. To get similar functionality of composite indexes in Dgraph you need to create multiple indexes. I can appreciate that they are useful, and maybe they will get added to the roadmap.

@campoy campoy added area/performance Performance related issues. kind/feature Something completely new we should consider. popular priority/P2 Somehow important but would not block a release. status/accepted We accept to investigate/work on it. and removed kind/enhancement Something could be better. kind/question Something requiring a response. labels Jul 12, 2019
@campoy campoy added this to the Unplanned (v1.x) milestone Jul 12, 2019
@aperotte
Copy link

aperotte commented Aug 1, 2019

One way to get something similar to composite indexes is to allow indexes on facets. This would be a sort of composite index on the (edge, facet) combination. It wouldn't be as general as full composite indexes but it seems like this approach would also work well with the idea of sharding by predicate (along with its indexes).

@minhaj-shakeel
Copy link
Contributor

Github issues have been deprecated.
This issue has been moved to discuss. You can follow the conversation there and also subscribe to updates by changing your notification preferences.

drawing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance Performance related issues. kind/feature Something completely new we should consider. popular priority/P2 Somehow important but would not block a release. status/accepted We accept to investigate/work on it.
Development

No branches or pull requests

7 participants