As you currently have it, only the last setSetNquads call is ultimately applied.
So a piece of data has to be requested hundreds of times, which is very slow
like this:
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject obj = jsonArray.getJSONObject(i);
String field = obj.getString(fieldName);
String query1 = “”
String query2 = '"
DgraphJavaClient.upsert(dgraphClient,query2,“uid(u) <”+fieldName+"> “”+field+"" .");
DgraphJavaClient.upsert(dgraphClient,query2,“uid(u) “”+formatDt+”" .");
DgraphJavaClient.upsert(dgraphClient,query1,“uid(v) uid(u) (update=”+formatDt+") .");
}
数据大小:433耗时:2129
剩余数据:4
数据大小:423耗时:2106
剩余数据:3
数据大小:297耗时:921
剩余数据:2
数据大小:216耗时:1503
剩余数据:1
数据大小:445耗时:2121
剩余数据:0
数据大小:335耗时:1975
数据大小:21215耗时:366637
Request help tell me how to improve the efficiency of java client