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

Very slow GROUP BY query, which could be much faster with better query plan #129

Closed
hannahbast opened this issue Sep 12, 2018 · 0 comments · Fixed by #133
Closed

Very slow GROUP BY query, which could be much faster with better query plan #129

hannahbast opened this issue Sep 12, 2018 · 0 comments · Fixed by #133
Assignees
Projects

Comments

@hannahbast
Copy link
Member

The following query is currently very slow on Wikipedia+FreebaseEasy:

SELECT ?object WHERE {
  ?subject <is-a> ?object 
}
GROUP BY ?object
ORDER BY DESC((COUNT(?object) AS ?count))

The log shows that the PSO index is scanned and then the 130K tuples from the predicate are sorted. The sorting is used to make the GROUP BY easy.

For the query above, it would clearly be better to use the POS index. Then there would be no need to sort for the GROUP BY ?object.

Note that the sorting required by the final ORDER BY is no problem, since there are only 47K distinct objects for this query.

@hannahbast hannahbast changed the title Very slow GROUP BY query, which could be fast reasily Very slow GROUP BY query, which could be fast easily Sep 13, 2018
@hannahbast hannahbast changed the title Very slow GROUP BY query, which could be fast easily Very slow GROUP BY query, which could be much faster with better query plan Sep 13, 2018
@niklas88 niklas88 added this to In progress in QLever Oct 2, 2018
QLever automation moved this from In progress to Done Oct 8, 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

Successfully merging a pull request may close this issue.

2 participants