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

fix: push down order hint of the query again #3797

Merged
merged 7 commits into from
Apr 26, 2024

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Apr 24, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

This PR fixes the issue that the region server doesn't push down the order hint of the query to the mito engine. This is the first step to optimize order by ts and order by ts limit statements.

It moves the DummyTableProvider to the common-query mod so the OptimizeRule can correctly downcast the table provider and attach the OrderOption to the provider.

Now we can get the order hint in the mito engine:

create table order_hint(a int primary key, ts timestamp time index);

select * from order_hint order by ts;

Then the debug log shows the hint

Scan region 4398046511104(1024, 0), request: ScanRequest { projection: Some([0, 1]), filters: [], output_ordering: Some([OrderOption { name: "ts", options: SortOptions { descending: false, nulls_first: false } }]), limit: None },

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@evenyag evenyag changed the title fix: push down order hint of the query fix: push down order hint of the query again Apr 24, 2024
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Apr 24, 2024
@killme2008 killme2008 added the C-performance Category Performance label Apr 24, 2024
@evenyag evenyag marked this pull request as ready for review April 25, 2024 07:49
@evenyag evenyag requested a review from a team as a code owner April 25, 2024 07:49
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 66.33663% with 68 lines in your changes are missing coverage. Please review.

Project coverage is 85.22%. Comparing base (bba3108) to head (141063b).
Report is 7 commits behind head on main.

❗ Current head 141063b differs from pull request most recent head 0a91572. Consider uploading reports for the commit 0a91572 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3797      +/-   ##
==========================================
- Coverage   85.56%   85.22%   -0.34%     
==========================================
  Files         946      948       +2     
  Lines      161083   161168      +85     
==========================================
- Hits       137827   137362     -465     
- Misses      23256    23806     +550     

src/query/src/dummy_catalog.rs Outdated Show resolved Hide resolved
src/query/src/dummy_catalog.rs Outdated Show resolved Hide resolved
@waynexia waynexia enabled auto-merge April 26, 2024 11:43
Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@v0y4g3r v0y4g3r left a comment

Choose a reason for hiding this comment

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

LGTM

@waynexia waynexia added this pull request to the merge queue Apr 26, 2024
Merged via the queue into GreptimeTeam:main with commit e410192 Apr 26, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-performance Category Performance docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants