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

analyze predicate column may not get stat info #56040

Open
wjhuang2016 opened this issue Sep 12, 2024 · 0 comments
Open

analyze predicate column may not get stat info #56040

wjhuang2016 opened this issue Sep 12, 2024 · 0 comments

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `tlc7a7bc3f` (
  `col_32` char(68) COLLATE gbk_bin DEFAULT 'LLQFjN0Ne7',
  `col_33` tinyint(1) NOT NULL DEFAULT '1',
  `col_34` timestamp NULL DEFAULT NULL,
  `col_35` mediumint(8) unsigned NOT NULL DEFAULT '1',
  `col_36` binary(79) NOT NULL DEFAULT '3I!s=Kqnf@=7-\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'
) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_bin;
CREATE TABLE `tl4f97ac94` (
  `col_1` double DEFAULT '8548.501650392927',
  `col_2` char(158) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '=I#8%wzce2DpvHr6YZB',
  `col_3` float NOT NULL,
  `col_4` varbinary(395) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci;
select   /*+ inl_join( tlc7a7bc3f ) */ tlc7a7bc3f.col_32 as r0 from tl4f97ac94 , tlc7a7bc3f where not( tlc7a7bc3f.col_35 in ( 15972450 ,2442965 ,13628873 ,8863316 ,12230202;
) ) order by r0;

dump column usges to mysql.column_stats_usage

analyze table tl4f97ac94 predicate column;

desc select   /*+ inl_join( tlc7a7bc3f ) */ tlc7a7bc3f.col_32 as r0 from tl4f97ac94 , tlc7a7bc3f where not( tlc7a7bc3f.col_35 in ( 15972450 ,2442965 ,13628873 ,8863316 ,12230202;

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

estRows for tl4f97ac94 is correct.

3. What did you see instead (Required)

TableFullScan_18         | 10000.00    | cop[tikv] | table:tl4f97ac94

4. What is your TiDB version? (Required)

master

@wjhuang2016 wjhuang2016 added the type/bug The issue is confirmed as a bug. label Sep 12, 2024
@Rustin170506 Rustin170506 added the sig/planner SIG: Planner label Sep 12, 2024
@Rustin170506 Rustin170506 self-assigned this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants