Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counting predicate cardinality should be fast #5813

Closed
EnricoMi opened this issue Jul 3, 2020 · 2 comments
Closed

Counting predicate cardinality should be fast #5813

EnricoMi opened this issue Jul 3, 2020 · 2 comments
Labels
area/performance Performance related issues. area/querylang Issues related to the query language specification and implementation. status/more-info-needed The issue has been sent back to the reporter asking for clarifications

Comments

@EnricoMi
Copy link

EnricoMi commented Jul 3, 2020

Experience Report

What you wanted to do

I want to know how many uids have a specific predicate.

What you actually did

The query

{
  result (func: has(pred)) {
    count(uid)
  }
}

gives me the number of uids that have predicate pred.

Why that wasn't great, with examples

This query is very slow for large predicates. There must be some index or cardinality information for a predicate available to answer this query in constant time. The "Schema" tab in Ratel provides for predicates the "Samples & Statistics" tab, which seems to fire the same query, which takes for ever. Improving this query would also improve UX for Ratel:
grafik

@danielmai
Copy link
Contributor

There's an existing feature request in #3054 to add quick approximate counts. Would this work for you?

@danielmai danielmai added area/performance Performance related issues. area/querylang Issues related to the query language specification and implementation. status/more-info-needed The issue has been sent back to the reporter asking for clarifications labels Jul 9, 2020
@minhaj-shakeel
Copy link
Contributor

Github issues have been deprecated.
This issue has been moved to discuss. You can follow the conversation there and also subscribe to updates by changing your notification preferences.

drawing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance Performance related issues. area/querylang Issues related to the query language specification and implementation. status/more-info-needed The issue has been sent back to the reporter asking for clarifications
Development

No branches or pull requests

3 participants