In our scenario we need to label a large number of points and perform node search through labels. But when storing tag-to-node relationships,mutation speed is extremely slow may because of the fanout of badger. How can I design schema or dgraph to be able to find all 10 million points by one label?
I use dgraph live to take the mutation, the time spent is 1h12m27.907689547s . The correct answer should be 10000000,but ratel returned 19000.
When I make the reverse relation, eg:<Alice-1> <label> <USA> . The same file only spent 3m0.41087837s to finish the mutation, and the count(uid) is 10000000. Should dgraph can hanle this situation?
Below is the rdf we use:
<USA> <country> “America” .
<Alice-0> <name> “Alice-0” .
<USA> <label> <Alice-0> .
<Alice-1> <name> “Alice-1” .
<USA> <label> <Alice-1> .
<Alice-2> <name> “Alice-2” .
<USA> <label> <Alice-2> .
<Alice-3> <name> “Alice-3” .
……till to Alice-10000000
shema:
<country>: string @index(hash) .
<name>: string @index(hash) .
<label>: [uid] @count .
Mutation is too slow to get name by country
{
node(func: eq(<country>,"America")) {
uid
<label>{
count(uid)
}
}
}
the result returned is
···
{
“node”: [
{
“uid”: “0x8ac7230489e80001”,
“label”: [
{
“count”: 19000
}
]
}
]
}
···
Hope to get your answer!