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

Provide direct way to count query results #38

Open
mkroetzsch opened this issue Sep 17, 2019 · 0 comments
Open

Provide direct way to count query results #38

mkroetzsch opened this issue Sep 17, 2019 · 0 comments

Comments

@mkroetzsch
Copy link
Collaborator

Many programs need to know the number of results rather than the individual results. Currently, VLog4j can only get this number by iterating through all query results to count them.

Instead, Vlog should have a direct method to return the number of results of a query. Like the query answering method, it should support counting with and without nulls. In many cases, this number should be much more efficiently retrievable by VLog. summing up the total size of IDB tables for a predicate should be easy. Indeed, it would be good to have a special method to count all facts for a predicate (no full-fledged query). Counting all facts that contain no nulls at all could also be easy if each IDB table would store this number (if it can be obtained cheaply when building the table).

For more specific queries (with constants or repeated variables), iteration would still be needed, but it is presumably faster if done in C++ directly rather than by sending all results as strings to Java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant