Skip to content

Commit

Permalink
Queries in warmup command now use INTERNAL SORT
Browse files Browse the repository at this point in the history
Since ad-freiburg/qlever#874 (merged on
13.02.2023), the warumup queries must use INTERNAL SORT and not ORDER BY
in order to be efficient.
  • Loading branch information
Hannah Bast committed Jun 18, 2023
1 parent 16b1e91 commit f132f56
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/management/commands/warmup.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ def clear(self, onlyUnpinned=False):
def pin(self):
prefixString = self._getPrefixString()

warmups = (
# Standard warmup queries.
warmups = [
(self.backend.warmupQuery1,
"Entities names aliases score, ordered by score, full result for Subject AC query with empty prefix"),
(self.backend.warmupQuery2,
Expand Down Expand Up @@ -152,13 +153,13 @@ def pin(self):
continue
self.log(" ")
self.log(f"Pin: {predicate} ordered by subject", format="bold")
query = f"SELECT ?x ?y WHERE {{ ?x {predicate} ?y }} ORDER BY ?x"
query = f"SELECT ?x ?y WHERE {{ ?x {predicate} ?y }} INTERNAL SORT BY ?x"
self.log(query)
self._pinQuery(f"{prefixString}\n{query}")

self.log(" ")
self.log(f"Pin: {predicate} ordered by object", format="bold")
query = f"SELECT ?x ?y WHERE {{ ?x {predicate} ?y }} ORDER BY ?y"
query = f"SELECT ?x ?y WHERE {{ ?x {predicate} ?y }} INTERNAL SORT BY ?y"
self.log(query)
self._pinQuery(f"{prefixString}\n{query}")

Expand All @@ -168,7 +169,7 @@ def pin(self):
continue
self.log(" ")
self.log(f"Pin: {pattern} ordered by subject only", format="bold")
query = f"SELECT ?x ?y WHERE {{ ?x {pattern} ?y }} ORDER BY ?x"
query = f"SELECT ?x ?y WHERE {{ ?x {pattern} ?y }} INTERNAL SORT BY ?x"
self.log(query)
self._pinQuery(f"{prefixString}\n{query}")

Expand Down

0 comments on commit f132f56

Please sign in to comment.