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

Implement pushdown for aggregate for PostgreSQL #3607

Merged
merged 10 commits into from
Oct 23, 2023
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into aggregation-pushdow…
…n-sqlite-3520
  • Loading branch information
noisersup committed Oct 19, 2023
commit 100e9c3c890f4f9627c8f2aa2a088781fc0a7530
9 changes: 9 additions & 0 deletions internal/handlers/sqlite/msg_explain.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,18 @@
}
}

// Limit pushdown is not applied if:
// - `filter` is set, it must fetch all documents to filter them in memory;
// - `sort` is set but `EnableSortPushdown` is not set, it must fetch all documents
// and sort them in memory;
// - `skip` is non-zero value, skip pushdown is not supported yet.
if params.Filter.Len() == 0 && (params.Sort.Len() == 0 || h.EnableSortPushdown) && params.Skip == 0 {
qp.Limit = params.Limit
}

if h.DisableFilterPushdown {
qp.Filter = nil
}

Check warning on line 121 in internal/handlers/sqlite/msg_explain.go

View check run for this annotation

Codecov / codecov/patch

internal/handlers/sqlite/msg_explain.go#L120-L121

Added lines #L120 - L121 were not covered by tests

if !h.EnableSortPushdown {
qp.Sort = nil
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.