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

histogram buckets has NULL value crated by fast analyze #24171

Closed
Tracked by #24150
rebelice opened this issue Apr 20, 2021 · 3 comments · Fixed by #24183
Closed
Tracked by #24150

histogram buckets has NULL value crated by fast analyze #24171

rebelice opened this issue Apr 20, 2021 · 3 comments · Fixed by #24183
Assignees
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@rebelice
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t (a int);
set @@tidb_enable_fast_analyze=1;
insert into t values(1), (2), (3), (NULL);
analyze table t with 0 topn, 2 buckets;
select * from mysql.stats_buckets;

2. What did you expect to see? (Required)

+----------+----------+---------+-----------+-------+---------+-------------+-------------+-----+
| table_id | is_index | hist_id | bucket_id | count | repeats | upper_bound | lower_bound | ndv |
+----------+----------+---------+-----------+-------+---------+-------------+-------------+-----+
|       53 |        0 |       1 |         0 |     3 |       1 | 2           |             |   0 |
|       53 |        0 |       1 |         1 |     1 |       1 | 3           | 3           |   0 |
+----------+----------+---------+-----------+-------+---------+-------------+-------------+-----+
2 rows in set (0.002 sec)

3. What did you see instead (Required)

The lower_bound is not NULL

4. What is your TiDB version? (Required)

| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-2663-gf23e34965
Edition: Community
Git Commit Hash: f23e349
Git Branch: HEAD
UTC Build Time: 2021-04-20 08:45:18
GoVersion: go1.16.1
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |

@rebelice rebelice added the type/bug The issue is confirmed as a bug. label Apr 20, 2021
@rebelice
Copy link
Contributor Author

/sig planner

@ti-chi-bot ti-chi-bot added the sig/planner SIG: Planner label Apr 20, 2021
@rebelice
Copy link
Contributor Author

/assign @rebelice

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants