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 with ORDER BY #2438

Closed
Tracked by #79 ...
AlekSi opened this issue Apr 16, 2023 · 2 comments · Fixed by #2506, #2530 or #2595
Closed
Tracked by #79 ...

Pushdown simplest sorting with ORDER BY #2438

AlekSi opened this issue Apr 16, 2023 · 2 comments · Fixed by #2506, #2530 or #2595
Assignees
Labels
code/chore Code maintenance improvements
Milestone

Comments

@AlekSi
Copy link
Member

AlekSi commented Apr 16, 2023

What should be done?

Currently, we rely on our Go code to sort documents the same way MongoDB does because PostgreSQL and other backends don't sort them the same way. But that requires us to fetch all documents before we can sort them, and that kills performance. Let's start investigating what we could do about that.

Let's add a new flag --test-enable-sorting-pushdown that would pushdown ORDER BY field ASC/DESC query part if:

  • the command is either find or aggregate;
  • find's command projection parameter is empty;
  • there is only one field name, and it does not use a dot notation.

If pushdown was performed, we should skip sorting with the Go code.

That flag should also be added to integration tests. No new automated tests or CI configurations are necessary.

Where?

pgdb.

Definition of Done

  • PostgreSQL handler updated;
  • spot refactorings done;
  • tested manually.
@AlekSi AlekSi added the code/chore Code maintenance improvements label Apr 16, 2023
This was referenced Apr 16, 2023
@AlekSi AlekSi reopened this May 1, 2023
@AlekSi AlekSi added not ready Issues that are not ready to be worked on; PRs that should skip CI and removed not ready Issues that are not ready to be worked on; PRs that should skip CI labels May 1, 2023
@rumyantseva rumyantseva assigned rumyantseva and unassigned noisersup May 2, 2023
@AlekSi
Copy link
Member Author

AlekSi commented May 8, 2023

That flag should also be added to integration tests.

That part wasn't done

@AlekSi AlekSi reopened this May 8, 2023
@rumyantseva
Copy link
Member

rumyantseva commented May 8, 2023

DoD: we only define the flag, some tests are expected to fail, we don't process the flag in the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment