You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hash Partitioning on primary key (long) doesn't work #4023
@MaksimSimkin why would you partition a table using its primary id? You should be partitioning by some other property other than the primary id. Possibly, if you are using Stuck.Id as a foreign key or something in a different table and if you partition that table using say StuckId, it makes sense.
Edit: If you want to use some sort of a partition number then that has to a property on Stuck like PartitionNumber and then you have to partition on it and not on Id
@mysticmind If i am doing partition on primary id i have always more or less equal amount of data in each partition, and i don't need to take care if the property i use is distributed the sam equally.
But actually the answer is: because i have it already. We are using marten in Version 3, our huge table has already this partitions and now we want to upgrade marten to latest version without database changes.
Got it, you have a pre-existing partition which you created yourself and now you are trying to use the Marten provided partitioning thinking it would seamlessly work. I think, you may want to check what Marten does for partitioning as a logic and get the state of your existing db in the exact similar way to get going.
If i am doing partition on primary id i have always more or less equal amount of data in each partition, and i don't need to take care if the property i use is distributed the sam equally.
Activity
mysticmind commentedon Nov 18, 2025
@MaksimSimkin why would you partition a table using its primary id? You should be partitioning by some other property other than the primary id. Possibly, if you are using
Stuck.Idas a foreign key or something in a different table and if you partition that table using sayStuckId, it makes sense.Edit: If you want to use some sort of a partition number then that has to a property on
StucklikePartitionNumberand then you have to partition on it and not onIdMaksimSimkin commentedon Nov 18, 2025
@mysticmind If i am doing partition on primary id i have always more or less equal amount of data in each partition, and i don't need to take care if the property i use is distributed the sam equally.
But actually the answer is: because i have it already. We are using marten in Version 3, our huge table has already this partitions and now we want to upgrade marten to latest version without database changes.
mysticmind commentedon Nov 18, 2025
Got it, you have a pre-existing partition which you created yourself and now you are trying to use the Marten provided partitioning thinking it would seamlessly work. I think, you may want to check what Marten does for partitioning as a logic and get the state of your existing db in the exact similar way to get going.
mysticmind commentedon Nov 18, 2025
Makes sense, gotcha!
mysticmind commentedon Nov 18, 2025
This is not a bug per se. So converting this to a discussion.