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

Apply pushdown for limit #2993

Merged
merged 25 commits into from
Jul 11, 2023
Merged

Conversation

chilagrow
Copy link
Member

@chilagrow chilagrow commented Jul 6, 2023

Description

Closes #2921.

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@chilagrow chilagrow added the code/bug Some user-visible feature works incorrectly label Jul 6, 2023
@chilagrow chilagrow self-assigned this Jul 6, 2023
@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Merging #2993 (a66644a) into main (9fc79b6) will decrease coverage by 2.03%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2993      +/-   ##
==========================================
- Coverage   76.25%   74.23%   -2.03%     
==========================================
  Files         386      386              
  Lines       21075    21107      +32     
==========================================
- Hits        16071    15669     -402     
- Misses       4078     4488     +410     
- Partials      926      950      +24     
Impacted Files Coverage Δ
integration/setup/test_helpers.go 100.00% <100.00%> (ø)
internal/handlers/common/explain.go 75.00% <100.00%> (+5.88%) ⬆️
internal/handlers/pg/msg_explain.go 80.00% <100.00%> (+1.12%) ⬆️
internal/handlers/pg/msg_find.go 87.58% <100.00%> (+0.26%) ⬆️
internal/handlers/pg/pgdb/query.go 79.01% <100.00%> (-1.19%) ⬇️

... and 31 files with indirect coverage changes

Flag Coverage Δ
hana ?
integration 70.65% <100.00%> (-2.17%) ⬇️
mongodb 5.41% <0.00%> (+0.02%) ⬆️
pg 60.45% <100.00%> (-5.83%) ⬇️
shard-1 54.18% <93.93%> (-1.90%) ⬇️
shard-2 36.70% <15.15%> (-17.91%) ⬇️
shard-3 57.06% <63.63%> (+0.48%) ⬆️
sqlite 46.48% <57.57%> (+0.07%) ⬆️
unit 24.24% <3.22%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@chilagrow chilagrow changed the title Apply pushdown for limit Apply pushdown for limit Jul 7, 2023
@chilagrow chilagrow marked this pull request as ready for review July 7, 2023 03:20
@chilagrow chilagrow requested a review from a team as a code owner July 7, 2023 03:20
@chilagrow chilagrow requested review from AlekSi, rumyantseva, a team, quasilyte and noisersup July 7, 2023 03:20
@chilagrow chilagrow enabled auto-merge (squash) July 7, 2023 03:21
@chilagrow chilagrow disabled auto-merge July 7, 2023 03:21
@chilagrow chilagrow enabled auto-merge (squash) July 7, 2023 03:21
@chilagrow chilagrow marked this pull request as draft July 10, 2023 09:18
@chilagrow chilagrow marked this pull request as ready for review July 10, 2023 10:04
@chilagrow chilagrow enabled auto-merge (squash) July 10, 2023 10:04
@chilagrow chilagrow requested a review from quasilyte July 10, 2023 11:13
@AlekSi AlekSi added this to the Next milestone Jul 10, 2023
internal/handlers/pg/pgdb/query.go Outdated Show resolved Hide resolved
internal/handlers/pg/msg_explain.go Outdated Show resolved Hide resolved
internal/handlers/pg/msg_explain.go Outdated Show resolved Hide resolved
internal/handlers/pg/msg_explain.go Outdated Show resolved Hide resolved
rumyantseva
rumyantseva previously approved these changes Jul 10, 2023
Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes themselves look good to me.
I see there are some comments in the PR, but I like the tests (and we discussed some logic during DS).

noisersup
noisersup previously approved these changes Jul 10, 2023
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks good to me

@chilagrow chilagrow dismissed stale reviews from noisersup and rumyantseva via 549f91a July 11, 2023 02:44
@chilagrow
Copy link
Member Author

chilagrow commented Jul 11, 2023

$ git diff
diff --git a/Taskfile.yml b/Taskfile.yml
index b1b02665..08a28904 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -196,6 +196,7 @@ tasks:
         -coverprofile=integration-pg.txt .
         -target-backend=ferretdb-pg
         -target-tls
+        -enable-sort-pushdown
         -postgresql-url=postgres://username@127.0.0.1:5432/ferretdb?pool_max_conns=50
         -compat-url='mongodb://username:password@127.0.0.1:47018/?tls=true&tlsCertificateKeyFile=../build/certs/client.pem&tlsCaFile=../build/certs/rootCA-cert.pem'
     vars:
$ task test-integration-pg TEST_RUN=TestQueryCommandLimitPushDown
task: [test-integration-pg] go test -count=1 -run='TestQueryCommandLimitPushDown' -timeout=35m -race=true -tags=ferretdb_debug,ferretdb_hana -shuffle=on -coverpkg=../... -coverprofile=integration-pg.txt . -target-backend=ferretdb-pg -target-tls -enable-sort-pushdown -postgresql-url=postgres://username@127.0.0.1:5432/ferretdb?pool_max_conns=50 -compat-url='mongodb://username:password@127.0.0.1:47018/?tls=true&tlsCertificateKeyFile=../build/certs/client.pem&tlsCaFile=../build/certs/rootCA-cert.pem'

ok      github.com/FerretDB/FerretDB/integration        1.589s  coverage: 40.0% of statements in ../...

Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chilagrow chilagrow merged commit f5deeb7 into FerretDB:main Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/bug Some user-visible feature works incorrectly
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

findOne() query is not translated correctly on Postgres
5 participants