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
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
Merge remote-tracking branch 'upstream/main' into pushdown-sort-2438
  • Loading branch information
noisersup committed Apr 28, 2023
commit 8770a28e37e262b16e835ca42d2ec11a89701b5c
16 changes: 13 additions & 3 deletions internal/handlers/pg/msg_aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,19 @@ func processStagesDocuments(ctx context.Context, p *stagesDocumentsParams) ([]*t
var docs []*types.Document

if err := p.dbPool.InTransaction(ctx, func(tx pgx.Tx) error {
iter, _, getErr := pgdb.QueryDocuments(ctx, tx, p.qp)
if getErr != nil {
return getErr
var err error
iter, _, err := pgdb.QueryDocuments(ctx, tx, p.qp)
if err != nil {
return err
}

closer := iterator.NewMultiCloser(iter)
defer closer.Close()

for _, s := range p.stages {
if iter, err = s.Process(ctx, iter, closer); err != nil {
return err
}
}

docs, err = iterator.ConsumeValues(iterator.Interface[struct{}, *types.Document](iter))
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.