Re: Define hash partition for certain column values

2021-01-13 Thread Голубева Яна
Sorry, I think I 've described my case not precisely enough. "Randomly" is not pure random in my case. My solution is planning to be used on different servers with different DBs. The initial data of the base table depends on the DB. But I know that the key value of the new rows is increasing. Not m

Re: Define hash partition for certain column values

2021-01-12 Thread Michael Lewis
On Tue, Jan 12, 2021 at 9:37 AM Alban Hertroys wrote: > > > On 12 Jan 2021, at 16:51, Голубева Яна wrote: > > > > Values for the key partitioning column are generated randomly and I > can't predict their distribution between ranges. > > If I just create some ranges I won't have any guarantee tha

Re: Define hash partition for certain column values

2021-01-12 Thread Alban Hertroys
> On 12 Jan 2021, at 16:51, Голубева Яна wrote: > > Values for the key partitioning column are generated randomly and I can't > predict their distribution between ranges. > If I just create some ranges I won't have any guarantee that partitions will > have similar amount of data. It is possib

Re: Define hash partition for certain column values

2021-01-12 Thread Rob Sargent
On 1/12/21 8:51 AM, Голубева Яна wrote: Values for the key partitioning column are generated randomly and I can't predict their distribution between ranges. If I just create some ranges I won't have any guarantee that partitions will have similar amount of data. It is possible that I will hav

Re: Define hash partition for certain column values

2021-01-12 Thread Голубева Яна
Values for the key partitioning column are generated randomly and I can't predict their distribution between ranges.If I just create some ranges I won't have any guarantee that partitions will have similar amount of data. It is possible that I will have 2 or 3 extremely big partitions and a bit of

Re: Define hash partition for certain column values

2021-01-12 Thread Michael Lewis
On Tue, Jan 12, 2021 at 1:21 AM Голубева Яна wrote: > List or range partitioning isn't suitable for my case. > I am using a column of numeric(20) type as a base for partitioning. The > values of the column are generated randomly. > So there will be too many partitions if I use list partitioning a

Re: Define hash partition for certain column values

2021-01-12 Thread Голубева Яна
Thank you for the answer! List or range partitioning isn't suitable for my case.I am using a column of numeric(20) type as a base for partitioning. The values of the column are generated randomly. So there will be too many partitions if I use list partitioning as is. I've tried to use an _expressio

Re: Define hash partition for certain column values

2021-01-11 Thread Ron
On 1/11/21 12:36 AM, Tom Lane wrote: =?utf-8?B?0JPQvtC70YPQsdC10LLQsCDQr9C90LA=?= writes: Hello, I've found in source code that there is a function satisfies_hash_partition(oid, modulus, remainder, column_values[]) which allows to check if the certain column value will be placed in the certa

Re: Define hash partition for certain column values

2021-01-10 Thread Tom Lane
=?utf-8?B?0JPQvtC70YPQsdC10LLQsCDQr9C90LA=?= writes: > Hello, I've found in source code that there is a function > satisfies_hash_partition(oid, modulus, remainder, column_values[]) which > allows to check if the certain column value will be placed in the certain > partition. I' d like to know

Define hash partition for certain column values

2021-01-10 Thread Голубева Яна
Hello, I've found in source code that there is a function satisfies_hash_partition(oid, modulus, remainder, column_values[]) which allows to check if the certain column value will be placed in the certain partition.I' d like to know if there is an opportunity not to check the certain partition but