Re: On partitioning, PKs and FKs

2021-07-08 Thread David G. Johnston
On Thursday, July 8, 2021, Wiwwo Staff wrote: > On Thu, 8 Jul 2021 at 21:42, Alban Hertroys com> wrote: > >> On 2021-07-08 13:30, Ron wrote: >> > Thus, the bigTable PK must be on id, columnX, (No, I don't like it >> > either.) >> >> That's not entirely true. You can keep the PK on id if you addi

Re: On partitioning, PKs and FKs

2021-07-08 Thread Wiwwo Staff
On Thu, 8 Jul 2021 at 21:42, Alban Hertroys wrote: > On 2021-07-08 13:30, Ron wrote: > > Thus, the bigTable PK must be on id, columnX, (No, I don't like it > > either.) > > That's not entirely true. You can keep the PK on id if you additionally > create a unique constraint on (id, columnX). > Uh

Re: On partitioning, PKs and FKs

2021-07-08 Thread Ron
The docs are pretty clear that all constraints must have the partition key as part of the key, and PK is most certainly a constraint. I welcome a counter-example. On 7/8/21 10:23 AM, Alban Hertroys wrote: On 2021-07-08 13:30, Ron wrote: > Thus, the bigTable PK must be on id, columnX, (No, I do

Re: On partitioning, PKs and FKs

2021-07-08 Thread Alban Hertroys
On 2021-07-08 13:30, Ron wrote:> Thus, the bigTable PK must be on id, columnX, (No, I don't like it > either.)That's not entirely true. You can keep the PK on id if you additionally create a unique constraint on (id, columnX).That way, you can at least be certain that the uniqueness of the PK remai

Re: On partitioning, PKs and FKs

2021-07-08 Thread Wiwwo Staff
Big big variability on partitioned column, which is filtered (where condition) in (almost) all queries. On Thu, 8 Jul 2021 at 14:23, Michael Lewis wrote: > Why are you using hash partitioning? >

Re: On partitioning, PKs and FKs

2021-07-08 Thread Michael Lewis
Why are you using hash partitioning?

Re: On partitioning, PKs and FKs

2021-07-08 Thread Ron
On 7/8/21 3:42 AM, Wiwwo Staff wrote: Hi! I have a big table bigTable which I partitioned by hash on field columnX, by creating bigTable_0, bigTable_1etc. Since I need a PK on bigTable.id, and table is not partitioned by id, and columnX is not unique, i added PK on bigTable_0.id, bigTable_1.id

On partitioning, PKs and FKs

2021-07-08 Thread Wiwwo Staff
Hi! I have a big table bigTable which I partitioned by hash on field columnX, by creating bigTable_0, bigTable_1 etc. Since I need a PK on bigTable.id, and table is not partitioned by id, and columnX is not unique, i added PK on bigTable_0.id, bigTable_1.id etc. So far, so good. Now I have another