Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nw8cw-0008W3-F2 for pgsql-hackers@arkaria.postgresql.org; Tue, 31 May 2022 20:38:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nw8cv-0002n3-7v for pgsql-hackers@arkaria.postgresql.org; Tue, 31 May 2022 20:38:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nw8cu-0002mu-TD for pgsql-hackers@lists.postgresql.org; Tue, 31 May 2022 20:38:04 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nw8cn-0004Gu-UJ for pgsql-hackers@lists.postgresql.org; Tue, 31 May 2022 20:38:04 +0000 Received: by mail-lf1-x129.google.com with SMTP id h23so1670458lfe.4 for ; Tue, 31 May 2022 13:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yugabyte.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LlqLoMSqjWOKLqN6Mh8d1AGGMVabkVxgK+Y854XeJDo=; b=aP4ewFSpX+Ig2jchSttOLACD8oAubyGBUmkcRUelovNI4XnWPaTtvqxOs4gNggPjAv XaUStOlbLa9GunKYKy8ExoRLZBR7i42Wmzp/G42OgSrBQcvdcf117fNdpNpHg3BiAnhH lX2wre6egJGBUBgKK8LO1aOvi/OnJ1CTGW3ew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LlqLoMSqjWOKLqN6Mh8d1AGGMVabkVxgK+Y854XeJDo=; b=n76Hy+sIjyhHfrE/Ic1zYc/HT7IaYeXqfYrf/1eKORcG+3qfqrNtqgk7E27g3fcK2/ YTeUlbLLA6ZojlHAn2NrnxvfnkpxktXrs1GdqIcWnG/t9sOdhTLKhmoUtvqfevteqc8u 4CFHx621wPK/DCiT+4c1amV+CllD+w6LDm3FGOJ+pUMkiENc7HLvSNMTxhy7RYXQxqtv AU2iTPO27cCfPZdKM9A5mKanSdYOZYVD3Pk1MlIqr8qb7Vz4bDJEp5bViDkTYGWXXMhE vad3pQz2ZPD3imO2/vM3nOoAPlroGHnev/917AwPGCLf8xjKFoOmK+XB9wbdg0+wRgJR jzyQ== X-Gm-Message-State: AOAM5308wB5aT4JERFBKfgTby4dVr9Xz4xvUbzXJCCU4yxMo7mtnVliC 7jMhaYtMAvtcBJMVuLyidO74ZZsWnHEuMKTZLUsbFQ== X-Google-Smtp-Source: ABdhPJwKZYPGQqK0f8M8PI8LukMLpWpKWi7cYxkv3wGPH/h6/HlksjVO73GsmFw68cDkiFcYqn95M2yNyYZfXChnvB4= X-Received: by 2002:a05:6512:201a:b0:478:5adc:fbbb with SMTP id a26-20020a056512201a00b004785adcfbbbmr38681827lfb.687.1654029477148; Tue, 31 May 2022 13:37:57 -0700 (PDT) MIME-Version: 1.0 References: <163714495450.16056.3566953095730878367@malur.postgresql.org> <28bcc918-ec5d-5287-963f-86c678db9ae0@postgrespro.ru> In-Reply-To: <28bcc918-ec5d-5287-963f-86c678db9ae0@postgrespro.ru> From: Zhihong Yu Date: Tue, 31 May 2022 13:43:26 -0700 Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Dmitry Koval Cc: Matthias van de Meent , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="0000000000006f147705e054bf56" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006f147705e054bf56 Content-Type: text/plain; charset="UTF-8" On Tue, May 31, 2022 at 12:43 PM Dmitry Koval wrote: > >Just out of curiosity, why is SPLIT / MERGE support not included for > >HASH partitions? Because sibling partitions can have a different > >modulus, you should be able to e.g. split a partition with (modulus, > >remainder) of (3, 1) into two partitions with (mod, rem) of (6, 1) and > >(6, 4) respectively, with the reverse being true for merge operations, > >right? > > You are right, SPLIT/MERGE operations can be added for HASH-partitioning > in the future. But HASH-partitioning is rarer than RANGE- and > LIST-partitioning and I decided to skip it in the first step. > Maybe community will say that SPLIT/MERGE commands are not needed... (At > first step I would like to make sure that it is no true) > > P.S. I attached patch with 1-line warning fix (for cfbot). > -- > With best regards, > Dmitry Koval > > Postgres Professional: http://postgrespro.com Hi, For attachPartTable, the parameter wqueue is missing from comment. The parameters of CloneRowTriggersToPartition are called parent and partition. I think it is better to name the parameters to attachPartTable in a similar manner. For struct SplitPartContext, SplitPartitionContext would be better name. + /* Store partition contect into list. */ contect -> context Cheers --0000000000006f147705e054bf56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, May 31, 2022 at 12:43 PM Dmit= ry Koval <d.koval@postgrespro.= ru> wrote:
http://postgrespro.com

<= div>Hi,
For=C2=A0attachPartTable, the parameter=C2=A0wqueue is mi= ssing from comment.
The parameters of=C2=A0CloneRowTriggersToPart= ition are called=C2=A0parent and=C2=A0partition. I think it is better to na= me the parameters to attachPartTable in a similar manner.
For struct SplitPartContext, SplitPartitionContext would be bet= ter name.

+ =C2=A0 =C2=A0 =C2=A0 /* Store partitio= n contect into list. */
contect ->=C2=A0context
<= div>
Cheers
--0000000000006f147705e054bf56--