8000 feat: support random partition rule by ShiKaiWi · Pull Request #1193 · apache/horaedb · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@ShiKaiWi
Copy link
Member
@ShiKaiWi ShiKaiWi commented Sep 4, 2023

Rationale

Currently, hash/key rule are the only supported rules for partition table. However, it will lead to small write batches if the user tries to use primary key or all tags as the partition key for a uniform distribution. And it is known that the small write batches hurt write performance badly.

Actually, for a partition table in append mode with primary key or all tags as partition key, most of the queries to this table will fan out to all the partitions because the partition key won't be provided in most cases. So what is the gain from the cost (the massive small write batches) to do such complex partition?

It will work much better if a simple partition rule is supported, by which a random partition is chosen for a given write request.

Detailed Changes

  • Introduce RandomPartitionRule
  • Add a new method called validate_create_table to TableEngine trait

Test Plan

Add unit test to apply RandomPartitionRule for a partition table in different mode.

@ShiKaiWi ShiKaiWi force-pushed the feat-support-partition-no-rule branch 2 times, most recently from 080b7f4 to c702375 Compare September 5, 2023 11:02
@ShiKaiWi ShiKaiWi force-pushed the feat-support-partition-no-rule branch from 55cc18a to 3c05f0e Compare September 7, 2023 02:20
@ShiKaiWi ShiKaiWi force-pushed the feat-support-partition-no-rule branch from 3c05f0e to 36e48d4 Compare September 7, 2023 05:45
Copy link
Contributor
@Rachelint Rachelint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShiKaiWi ShiKaiWi merged commit 1252192 into apache:main Sep 7, 2023
@ShiKaiWi ShiKaiWi deleted the feat-support-partition-no-rule branch September 7, 2023 06:15
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

Successfully merging this pull request may close these issues.

2 participants

0