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

Enhancement: FixedLenKeyIndex: remove same bytes in the middle #48

Closed
rockeet opened this issue Jun 3, 2023 · 1 comment
Closed

Enhancement: FixedLenKeyIndex: remove same bytes in the middle #48

rockeet opened this issue Jun 3, 2023 · 1 comment

Comments

@rockeet
Copy link
Collaborator

rockeet commented Jun 3, 2023

Now we have removed common prefix len in FixedLenKeyIndex.

In some cases, there are many common bytes in the middle of keys, for example:

In MyTopling, secondary keys has primary key at the end, common prefix in primary keys are the middle bytes of secondary keys, these bytes can be removed.

CREATE TABLE a (
  id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  ts DATETIME,
  INDEX(ts)
);

Encoded key of secondary index ts has form ts(DATETIME) id(BIGINT), in which there are many zero leading bytes in id.

@rockeet
Copy link
Collaborator Author

rockeet commented Nov 22, 2023

@rockeet rockeet closed this as completed Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant