-
Notifications
You must be signed in to change notification settings - Fork 753
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
bug(query): behavior not like MySQL when set LIMIT 0 #16399
Comments
Hey @scbizu! I'm here to help you with any bugs, questions, or contributions you have for databend. Let's work together to solve this issue! I found a similar closed issue: Support Output MySQL format, which was last updated on May 30, 2024. This issue was referenced by another issue: tracing issues about OutputFormat & result compare of tests, also last updated on May 30, 2024. The suggested solution was to refactor Regarding the specific behavior of Databend when using Additionally, the source code for the This behavior might impact performance, especially for client-drivers and SQL frameworks that use this feature to check SQL validation and extract metadata. |
Maybe you need ignore result? SELECT number FROM numbers(2) IGNORE_RESULT; https://docs.databend.com/sql/sql-commands/query-syntax/query-select#ignore_result |
This is a optimizer issue? cc @xudong963 |
No, this still scan full tables but ignore the result. |
Join is blocking operator, so limit return early will not be reached.
|
Yes. |
Search before asking
Version
v1.2.629-nightly
What's Wrong?
As MySQL documented:
In databend , when set LIMIT 0 (or LIMIT 0,0) , the EXPLAIN (I paste it in Slack) said databend still performs full table data scan instead of only extracting the metadata . Some of client-drivers and SQL frameworks use this feature to check SQL validation and do extract the metadata to the ORM-based structure . With too much data scanning , the performance will step down in this case.
How to Reproduce?
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: