Performance issue with count index

Hello.
When we add count index in our schema, the insertion of new tuples is very slow. Without count index we have around 50000 insertions/sec, but when we add the count index, the insertions fall to 100 insertions/sec.
We think this is a bug, but we are not sure.
Thanks in advance

Dgraph metadata

Dgraph version : v21.03.2
Dgraph codename : rocket-2
Dgraph SHA-256 : 00a53ef6d874e376d5a53740341be9b822ef1721a4980e6e2fcb60986b3abfbf
Commit SHA-1 : b17395d33
Commit timestamp : 2021-08-26 01:11:38 -0700
Branch : HEAD
Go version : go1.16.2
jemalloc enabled : true

1 Like

The count index is one of the more expensive indexes in Dgraph. The way it currently works does dramatically affect write performance in the way you described while giving you the ability to run count queries from the root func.

Thanks for your fast response

1 Like