Why queries are slow during load?

while i am running my code inserting data to dgraph, then even simple queries run very slow, like ddd(func: has(type_Work)) { count(uid) } query takes 40 seconds for 200k edges only
when i stop loading data, queries run normally.
so, in highly updated systems, there is no way to have realtime queries, am i right?
if it’s because of transactions (edges are locked for read, whatever), is it a way to disable transactions since we don’t use them at all?

nops, as far know, transactions are intrinsic to Dgraph at this point. And I do not imagine that’s the problem.

You can implement Apollo Graphql and use subscriptions to this.

The staff is working on improvements in the Has function.

Cheers.

it’s not about “has” function, when load stops, query runs for milliseconds even on millions of edges. but when i start loading data, it takes up to tens of minutes.

that’s the problem

btw, i have a lot of “old” transactions in logs. may be it’s the case:

2018/10/19 18:17:04 draft.go:769: Found 117 old transactions. Acting to abort them.
2018/10/19 18:17:04 draft.go:746: TryAbort 117 txns with start ts. Error: <nil>
2018/10/19 18:19:05 draft.go:772: abortOldTransactions for 117 txns. Error: <nil>
2018/10/19 18:20:08 draft.go:769: Found 192 old transactions. Acting to abort them.
2018/10/19 18:20:08 draft.go:746: TryAbort 192 txns with start ts. Error: <nil>
2018/10/19 18:23:48 draft.go:769: Found 64 old transactions. Acting to abort them.
2018/10/19 18:23:48 draft.go:746: TryAbort 64 txns with start ts. Error: <nil>
2018/10/19 18:24:02 draft.go:772: abortOldTransactions for 192 txns. Error: <nil>
2018/10/19 18:24:42 draft.go:772: abortOldTransactions for 64 txns. Error: <nil>
2018/10/19 18:26:03 draft.go:769: Found 84 old transactions. Acting to abort them.
2018/10/19 18:26:04 draft.go:746: TryAbort 84 txns with start ts. Error: <nil>
2018/10/19 18:27:17 draft.go:772: abortOldTransactions for 84 txns. Error: <nil>
2018/10/19 18:29:07 draft.go:769: Found 11 old transactions. Acting to abort them.
2018/10/19 18:29:07 draft.go:746: TryAbort 11 txns with start ts. Error: <nil>
2018/10/19 18:30:51 draft.go:772: abortOldTransactions for 11 txns. Error: <nil>
2018/10/19 18:32:44 draft.go:769: Found 227 old transactions. Acting to abort them.
2018/10/19 18:32:44 draft.go:746: TryAbort 227 txns with start ts. Error: <nil>

but in data load procedure i use autocommit, so have no idea how they appear:

  def runMutation(q: String): Unit = {
    val txn = dgraphClient.newTransaction
    try {
      val mu = Mutation.newBuilder()
        .setSetNquads(ByteString.copyFromUtf8(q))
        .setCommitNow(true)
        .setIgnoreIndexConflict(true)
        .build
      txn.mutate(mu)
    } catch {
      case e: Exception => {
        println(e.getMessage)
        //println(q)
      }
    } finally {
      txn.discard()
    }
  }

nope, i turned off parallel load, “old” transactions errors disappeared (now have just few “A tick missed to fire. Node blocks too long” ones), but simple “has” query still takes a lot of time when load procedure is running

What Dgraph version do you use?
Please, do this https://docs.dgraph.io/v1.0.9/deploy/#upgrade-database and upgrade if so.

i am using the last one, 1.0.9

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.