-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
display row width in results of explain statements #20676
Comments
@SunRunAway @eurekaka @zz-jason What're your opinions? |
Another option is to put into |
|
I think the cost is more important than the rows or width? i.e. these are all just dimensions that factor into the cost. May I suggest renaming the column to mysql> explain select count(*) from t use index(primary) where a<=1 and b>=2;
+-----------------------------+------------------+-----------+---------------+----------------------------------+
| id | cost | task | access object | operator info |
+-----------------------------+------------------+-----------+---------------+----------------------------------+
| StreamAgg_10 | 1232 [1.00; 7] | root | | funcs:count(1)->Column#5 |
| └─TableReader_17 | 231 [0.75; 456] | root | | data:Selection_16 |
| └─Selection_16 | 32 [0.75; 1234] | cop[tikv] | | ge(test.t.b, 2) |
| └─TableRangeScan_15 | 343 [1.00; 2333] | cop[tikv] | table:t | range:[-inf,1], keep order:false |
+-----------------------------+------------------+-----------+---------------+----------------------------------+ (Many other DBs show cost in their explain output). |
I think this is better! What do you think? @SunRunAway @eurekaka @zz-jason |
Feature Request
Is your feature request related to a problem? Please describe:
Since one part of our cost model is
estRows * rowWidth * scanFactor
, the parameterrowWidth
has an impact on the cost, but now TiDB only displaysestRows
when processingexplain
, which may confuse users in some cases, for example:As shown above,
PK
has a better selectivity withestRows=1
thanIDX
withestRows=3
, but the optimizer choosesIDX
.This may confuse our users if they don't know the impact of
rowWidth
on cost, and also make it harder for optimizer maintainers to investigate index selection problems.Describe the feature you'd like:
Like PG, display
rowWidth
in results ofexplain
:We can display this field in
operator info
:The text was updated successfully, but these errors were encountered: