-
Notifications
You must be signed in to change notification settings - Fork 900
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
Support space partitions per distinct value #544
Comments
You can specify a custom partitioning function (see explanation for the |
So, to enforce 1 partition per field value, i should initialize hypertable with 3 space partition and use an identity (f(x)->x) partitioning function, right? |
@mbande the function can't be the identity function. The purpose of the partitioning function is to map a value onto a int32 (positive) key space. That key space is then divided evenly across the number of partitions. So, for three partitions and an input value of 1, the partitioning function needs to output a positive int32 between 0 and INT32_MAX/3. For 2 and 3 it would be analogous but falling instead into the two remaining ranges. |
We have the exact same usecase, any plans to add this as a new feature? More generic would be a possibility to dynamically add new partitions, just how a hypertable makes new partitions based on time ranges, but in this case based on unique ids. |
Where can I find more info about partitioning_func? An example that goes through defining the function and passing it to I only see this entry in the documentation: |
Related to #563 |
Any update on this please? |
I belive this might work:
|
I have a table with an integer field that takes limited values 1,2,3.
and I want to space partition by this field, one partition for each value, i.e. to create 3 partitions and use value as exact partition id.
searching the documentation, I cant figure out an easy solution for this.
The text was updated successfully, but these errors were encountered: