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

Pushdown simplest sorting for aggregate command #2530

Merged
merged 26 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
noisersup committed Apr 27, 2023
commit 5b9789136f92809050c248c0f1d4b3bc9c950e5a
2 changes: 1 addition & 1 deletion cmd/ferretdb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func run() {

TestOpts: registry.TestOpts{
DisableFilterPushdown: cli.Test.DisableFilterPushdown,
NativeSort: cli.Test.EnableSortingPushdown,
EnableSortPushdown: cli.Test.EnableSortingPushdown,
EnableCursors: cli.Test.EnableCursors,
},
})
Expand Down
2 changes: 1 addition & 1 deletion internal/handlers/pg/msg_find.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (h *Handler) MsgFind(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, er
qp.Filter = params.Filter
}

if h.NativeSort {
if h.EnableSortPushdown {
qp.Sort = params.Sort
}

Expand Down
2 changes: 1 addition & 1 deletion internal/handlers/pg/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type NewOpts struct {

// test options
DisableFilterPushdown bool
NativeSort bool
EnableSortPushdown bool
EnableCursors bool
}

Expand Down
2 changes: 2 additions & 0 deletions internal/handlers/pg/pgdb/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ func prepareSortClause(p *Placeholder, sort *types.Document) (string, []any, err
if err != nil {
return "", nil, err
}

key = k
}

// Skip sorting dot notation
Expand Down
4 changes: 2 additions & 2 deletions internal/handlers/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type NewHandlerOpts struct {
// TestOpts represents experimental configuration options.
type TestOpts struct {
DisableFilterPushdown bool
NativeSort bool
EnableSortPushdown bool
EnableCursors bool
}

Expand Down Expand Up @@ -102,7 +102,7 @@ func init() {
StateProvider: opts.StateProvider,

DisableFilterPushdown: opts.DisableFilterPushdown,
NativeSort: opts.NativeSort,
EnableSortPushdown: opts.EnableSortPushdown,
EnableCursors: opts.EnableCursors,
}
return pg.New(handlerOpts)
Expand Down