I saw that bloomfilters are enabled in dgraph - I assume this will help for a query that will “miss” ? If so, that’s perfect for my use case - is there a way I can just bump that up a ton? Almost every query I run is likely to have 0 results.
Hi @longShot, the bloom filters are enabled by default.
By bumping up a ton, you mean you want a less false positive rate? If that’s so, then you can modify that here in badger (BloomFalsePositive ). Again, this is a trade-off between speed and memory efficiency. Larger the filter, smaller the false positive rate.
EDIT: Hey, @longShot, the better way is to set it in dgraph explicitly, in the function setBadgerOptions and not to mess with the default options. This is where we set the other options for badger config too.
I think the question is not about tuning the FP rate, but performance.
i am in a similar position where, give or take, I expect > 99% of all queries I ever make to not return results. Optimizing to ensure that we can take a fast path for this is a major win for our use case.
So I suppose in that regard, by decreasing the FP rate, we are in a sense decreasing the number of times a miss would have to take the slower path? Or is there some other optimization we could take? What would reasonable values be?