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
wip
  • Loading branch information
noisersup committed Oct 20, 2023
commit 5f2f64a071bb213a5881f813088cb3f4be0ef4c5
6 changes: 2 additions & 4 deletions internal/handlers/sqlite/msg_explain.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,12 @@
Filter: params.Filter,
}

sort := params.Sort

if params.Aggregate {
qp.Filter, sort = aggregations.GetPushdownQuery(params.StagesDocs)
qp.Filter, params.Sort = aggregations.GetPushdownQuery(params.StagesDocs)
}

// Skip sorting if there are more than one sort parameters
if h.EnableSortPushdown && sort.Len() == 1 {
if h.EnableSortPushdown && params.Sort.Len() == 1 {
var order types.SortType

k := params.Sort.Keys()[0]
Expand All @@ -117,8 +115,8 @@
}

if h.DisableFilterPushdown {
qp.Filter = nil
}

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

View check run for this annotation

Codecov / codecov/patch

internal/handlers/sqlite/msg_explain.go#L118-L119

Added lines #L118 - L119 were not covered by tests

if !h.EnableSortPushdown {
qp.Sort = nil
Expand Down
Loading