Query takes < 1 second in Ratel, but 25 seconds from C# library

Report a Dgraph Client Bug

What Dgraph client (and version) are you using?

(put “x” in the box to select)

  • Dgo
  • PyDgraph
  • Dgraph4J
  • Dgraph-js
  • Dgraph-js-http
  • Dgraph.NET

Version:

What version of Dgraph are you using?

v21.03.0-76-ged09b8cc1

Have you tried reproducing the issue with the latest release?

If it is different from the one above, I don’t think so.

What is the hardware spec (RAM, OS)?

unknown

Steps to reproduce the issue (command/config used to run Dgraph).

Run this query

query getPastGoalsForReflections($backfillDate: string, $batchSize: string, $offset: string)
        {
	        goals(func: has(goalTitle), first:$batchSize, offset:$offset) @filter(
              type(GOAL) and
              (gt(startTimeInMillis, $backfillDate)
    	        or
    	        gt(endTimeInMillis, $backfillDate))
                and not eq(importedAsReflection, true)
            ) {
                goalUid: uid
                goalTitle
                startTimeInMillis
                endTimeInMillis
		    creator: goalCreatedByOrgUser @normalize {
			        orgUserId: uid
                    org: belongsTo @filter(TYPE(ORGANIZATION)) {
                        orgId: uid
                    }                    
            }
            owner: goalAssignedToOrgUser @normalize {
		        orgUserId: uid
                org: belongsTo @filter(TYPE(ORGANIZATION)) {
                    orgId: uid
                }                              
            }
            collaborators: goalCollaboratedByOrgUsers @normalize {
			    orgUserId: uid
                org: belongsTo @filter(TYPE(ORGANIZATION)) {
                    orgId: uid
                }                
            }
          }
        }

where the backfillDate is a timestamp in milliseconds, batch 100 offset 0
Run that in Ratel,
Then also run through C# using the .Net library Query method.
var result = await _dgraphService.Query(query, varMap, null);

Expected behaviour and actual result.

Expected: Ratel and Dgraph C# library run the same query in the same amount of time.

Actual: Ratel runs the query in about 0.2 seconds. Dgraph C# library runs it in 25 seconds.

We are refactoring this lib. If you have an reproducible example that would help.

The only reproduce I have at the moment is the one in the ticket that is specific to our org. it was consistently hitting 25-30 seconds both when we timed it in code and when viewing the log in Jaeger

What would be causing this to take that much longer, though? 0.2 seconds and 25 seconds are very different and wanting to know why that is happening.

We don’t have a .NET dedicated developer. We have contracted one(not dedicated) and we are in process to review and tests his work. I personally can’t tell what is happening in your case. I know a bit of .NET, but that’s not my main coding lang. If you have a way to reproduce it without your private data. That would help.

Cheers.