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

[Tech Request]: optimize reader to support filer on unsorted block #13959

Closed
2 tasks done
XuPeng-SH opened this issue Jan 2, 2024 · 0 comments
Closed
2 tasks done

[Tech Request]: optimize reader to support filer on unsorted block #13959

XuPeng-SH opened this issue Jan 2, 2024 · 0 comments
Assignees
Labels
kind/performance kind/tech-request New feature or request priority/p0 Critical feature that should be implemented in this version
Milestone

Comments

@XuPeng-SH
Copy link
Contributor

Is there an existing issue for the same tech request?

  • I have checked the existing issues.

Does this tech request not affect user experience?

  • This tech request doesn't affect user experience.

What would you like to be added ?

optimize reader to support filer on unsorted block

Why is this needed ?

>>> create table t1 (id int not null auto_increment, unique key `id` (`id`));
>>> insert into t1 (select * from generate_series(1, 50000000, 1)g);
>>> explain select * from t1 where id=500;
+----------------------------------------------------------------------------------------------------------------------+
| QUERY PLAN                                                                                                           |
+----------------------------------------------------------------------------------------------------------------------+
| Project                                                                                                              |
|   ->  Join                                                                                                           |
|         Join Type: INNER                                                                                             |
|         Join Cond: (t1.__mo_fake_pk_col = __mo_index_unique_85292ace-a937-11ee-9895-acde48001122.__mo_index_pri_col) |
|         Runtime Filter Build: #[-1,0]                                                                                |
|         ->  Table Scan on test.t1                                                                                    |
|               Runtime Filter Probe: t1.__mo_fake_pk_col                                                              |
|         ->  Table Scan on test.__mo_index_unique_85292ace-a937-11ee-9895-acde48001122                                |
|               Filter Cond: (__mo_index_unique_85292ace-a937-11ee-9895-acde48001122.__mo_index_idx_col = 500)         |
|               Block Filter Cond: (__mo_index_unique_85292ace-a937-11ee-9895-acde48001122.__mo_index_idx_col = 500)   |
+----------------------------------------------------------------------------------------------------------------------+

t1 is never sorted by the fake key and right now the reader will not apply any input filter
we have to consider fake pk and cluster key:

  1. no cluster key with pk
  2. cluster key with fake pk

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/performance kind/tech-request New feature or request priority/p0 Critical feature that should be implemented in this version
Projects
None yet
Development

No branches or pull requests

2 participants