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

Query with one ql:has-predicate triple is slow if COUNT is in ORDER BY clause #103

Closed
hannahbast opened this issue Aug 17, 2018 · 0 comments
Assignees
Projects

Comments

@hannahbast
Copy link
Member

The following query is very slow (46 seconds) on http://qlever.informatik.uni-freiburg.de/?backend=1 (Wikipedia+FreebaseEasy with up-to-date QLever build as of this writing):

SELECT ?predicate WHERE {
  ?x ql:has-predicate ?predicate
}
GROUP BY ?predicate
ORDER BY DESC((COUNT(?predicate) AS ?count))

However, the following query, which puts the COUNT in the SELECT clause instead of in the ORDER BY clause (and thus actually has more work to do) is much faster (~ 0.4 seconds):

SELECT ?predicate (COUNT(?predicate) AS ?count) WHERE {
  ?x ql:has-predicate ?predicate
}
GROUP BY ?predicate
ORDER BY DESC(?count)

The reason is obviously that the pattern trick is used for the second query, but not for the first query. The solution is obviously to also use it for the first query.

@niklas88 niklas88 added this to To do in QLever Aug 31, 2018
QLever automation moved this from To do to Done Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
QLever
  
Done
Development

No branches or pull requests

2 participants