We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue. Thanks!
mysql> explain format='verbose' select /*+ hash_agg() */ count(*) from t; +---------------------------+---------+---------+-----------+---------------+---------------------------------+ | id | estRows | estCost | task | access object | operator info | +---------------------------+---------+---------+-----------+---------------+---------------------------------+ | HashAgg_9 | 1.00 | 0.00 | root | | funcs:count(Column#4)->Column#3 | | └─TableReader_10 | 1.00 | 9.08 | root | | data:HashAgg_5 | | └─HashAgg_5 | 1.00 | 42.68 | cop[tikv] | | funcs:count(1)->Column#4 | | └─TableFullScan_8 | 3.00 | 119.00 | cop[tikv] | table:t | keep order:false | +---------------------------+---------+---------+-----------+---------------+---------------------------------+ 4 rows in set (0.00 sec)
The actual cost of this plan is correct, but the traced cost(estCost in the explain result) is not correct.
estCost
The cost of HashAgg_9 shouldn't be 0.
HashAgg_9
It's 0.
mysql> select tidb_version(); +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | tidb_version() | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Release Version: v5.5.0-alpha-430-gc19e899b6 Edition: Community Git Commit Hash: c19e899b6559ffbb0c5ab9c5c95fbf59289f5b07 Git Branch: master UTC Build Time: 2022-02-28 13:37:46 GoVersion: go1.16.3 Race Enabled: false TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 Check Table Before Drop: false | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
The text was updated successfully, but these errors were encountered:
planner: fix incorrect estCost displayed in explain results (#33675)
3388915
close #32672
qw4990
Successfully merging a pull request may close this issue.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
The actual cost of this plan is correct, but the traced cost(
estCost
in the explain result) is not correct.2. What did you expect to see? (Required)
The cost of
HashAgg_9
shouldn't be 0.3. What did you see instead (Required)
It's 0.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: