Skip to content

Commit

Permalink
perf(graphql): use tag height to filter when appropriate PE-4335
Browse files Browse the repository at this point in the history
This should help SQLite do a bit less work by allowing it to filter on
height before doing any joining.
  • Loading branch information
djwhitt committed Aug 3, 2023
1 parent c2cd3cc commit 2bedfc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/database/standalone-sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1353,11 +1353,11 @@ export class StandaloneSqliteDatabaseWorker {
}

if (minHeight != null && minHeight > 0) {
query.where(sql.gte(`${heightTableAlias}.height`, minHeight));
query.where(sql.gte(`${heightSortTableAlias}.height`, minHeight));
}

if (maxHeight != null && maxHeight >= 0 && maxHeight < maxDbHeight) {
query.where(sql.lte(`${heightTableAlias}.height`, maxHeight));
query.where(sql.lte(`${heightSortTableAlias}.height`, maxHeight));
}

if (
Expand Down

0 comments on commit 2bedfc7

Please sign in to comment.