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

Open
pierreis opened this issue Oct 12, 2018 · 4 comments

Comments

@pierreis
Copy link

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.

@manishrjain

This comment has been minimized.

Copy link
Member

commented Jan 16, 2019

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

@naivefun

This comment has been minimized.

Copy link

commented Mar 16, 2019

@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

This comment has been minimized.

Copy link
Contributor

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.

@aperotte

This comment has been minimized.

Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.