Hello Michel, Anthony, Jonathan and miko
@MichelDiz @amaster507 @jdgamble555 @miko !
Because you think it might be a problem with Chinese strings, so I repeated this experiment without using Chinese data,
still got the same error
The Type System in our dgraph schema is
like
type <id> {
id_number
~person_with_id
}
type <person> {
name
person_with_id
gender
}
<gender>: [string] @index(hash) .
<id_number>: [string] @index(hash) .
<name>: [string] @index(hash) .
<person_with_id>: [uid] @count @reverse .
As in the previous experiment, we still checked the data to ensure that each person has a name,
and the query result by type(person) is still less than has(name).
# query by type(person)
{
res(func: type(<person>)) {
count(uid)
}
}
# result
{
"data": {
"res": [
{
"count": 20327334
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 60658,
"processing_ns": 9196903337,
"encoding_ns": 4210614182,
"assign_timestamp_ns": 436762,
"total_ns": 13408087207
},
"txn": {
"start_ts": 40741
},
"metrics": {
"num_uids": {
"_total": 0,
"dgraph.type": 0
}
}
}
}
and query by has(name)
{
res(func: has(<name>)) {
count(uid)
}
}
# result
{
"data": {
"res": [
{
"count": 20327727
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 49874,
"processing_ns": 37059444391,
"encoding_ns": 4188967194,
"assign_timestamp_ns": 346657,
"total_ns": 41251798784
},
"txn": {
"start_ts": 40736
},
"metrics": {
"num_uids": {
"_total": 0,
"name": 0
}
}
}
}
But when we check these missing nodes, there are still person dgraph.type values.
{
res(func: has(<name>)) @filter(not type(<person>)) {
count(uid)
uid
dgraph.type
}
}
{
"data": {
"res": [
{
"count": 393
},
{
"uid": "0xfda573587ff07",
"dgraph.type": [
"person"
]
},
{
"uid": "0x109cb6fcbf1403",
"dgraph.type": [
"person"
]
},
{
"uid": "0x10d811ed0800c7",
"dgraph.type": [
"person"
]
},
{
"uid": "0x10e4bfe904f30e",
"dgraph.type": [
"person"
]
},
{
"uid": "0x10f5004dd1d557",
"dgraph.type": [
"person"
]
},
{
"uid": "0x11804fb41c2203",
"dgraph.type": [
"person"
]
},
{
"uid": "0x11da6826e6e22b",
"dgraph.type": [
"person"
]
},
{
"uid": "0x12b1e49b8586b1",
"dgraph.type": [
"person"
]
},
{
"uid": "0x12d27b2fb47ec4",
"dgraph.type": [
"person"
]
},
"....."
]
},
"extensions": {
"server_latency": {
"parsing_ns": 81467,
"processing_ns": 46168463968,
"encoding_ns": 609478,
"assign_timestamp_ns": 542048,
"total_ns": 46169760026
},
"txn": {
"start_ts": 40705
},
"metrics": {
"num_uids": {
"": 393,
"_total": 20328906,
"dgraph.type": 20328120,
"name": 0,
"uid": 393
}
}
}
}