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

query both max and min very slow #12040

Closed
bearHunting opened this issue Sep 5, 2019 · 1 comment · Fixed by #12083
Closed

query both max and min very slow #12040

bearHunting opened this issue Sep 5, 2019 · 1 comment · Fixed by #12083
Assignees
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@bearHunting
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    for a field with index, such as fa, query with both max and min, such as select max(fa), min(fa) from table_name

  2. What did you expect to see?
    result comes out very quickly

  3. What did you see instead?
    query running without any comeout.
    but when run for single max(fa) or min(fa), result comes out in a second

  4. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    v2.1.13
    tidb bug report

@bearHunting bearHunting added the type/bug The issue is confirmed as a bug. label Sep 5, 2019
@francis0407
Copy link
Member

Thanks for your reporting.
TiDB only rewrites single max/min to sort + limit 1 currently, I'm gonna fix this.

@lzmhhh123 lzmhhh123 added type/enhancement The issue or PR belongs to an enhancement. and removed type/bug The issue is confirmed as a bug. labels Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants