public inbox for [email protected]  
help / color / mirror / Atom feed
From: Robert Haas <[email protected]>
To: Justin Pryzby <[email protected]>
Cc: Pavel Borisov <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: Anastasia Lubennikova <[email protected]>
Cc: Rahila Syed <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Fabien COELHO <[email protected]>
Cc: Amul Sul <[email protected]>
Subject: Re: [PATCH] Automatic HASH and LIST partition creation
Date: Tue, 20 Jul 2021 15:34:22 -0400
Message-ID: <CA+TgmoatUTK+MODYF3F1Fb_LH77b2dn0d8F1C3tfyTF66tWbhw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAH2L28vRKPw+uf3Voiy6zy5QUghTPueErNTz_xgpkxEKnmfL1A@mail.gmail.com>
	<CALT9ZEH4YotxVz4n4CdeFO7fvkg1EczZJUAWpfzERNZzm4X6fg@mail.gmail.com>
	<CALT9ZEGG11+p3URZgKbKz62Vu5Fj10OKq4P59V=coiNnr7eO1g@mail.gmail.com>
	<[email protected]>
	<CA+hUKGL3ymvLb67Hsjh3scGFwRStcwzOkdLtuDwEF+nz_vbyyQ@mail.gmail.com>
	<CALT9ZEHSqRaANsDe2kmnk5W3MBgiq8Nu0Z5T88-jXzDW3tmh=w@mail.gmail.com>
	<[email protected]>
	<CA+TgmoZS3cjrWoTvvnCQjas-VXnPtiN8y+FNqP-0FobSS_0fYA@mail.gmail.com>
	<CALT9ZEEA-_1LthvsKAy0bNnyhzUm1g3pE=nk708_pX8DsfQQ8g@mail.gmail.com>
	<CA+TgmoYH_x4sJySQHii55aS-czv89W7p_4ieFHQwkUXQWZM-7Q@mail.gmail.com>
	<[email protected]>

On Tue, Jul 20, 2021 at 3:13 PM Justin Pryzby <[email protected]> wrote:
> On Tue, Jul 20, 2021 at 02:42:16PM -0400, Robert Haas wrote:
> > The bigger issue IMHO with on-the-fly
> > partition creation is avoiding deadlocks in the presence of current
> > inserters; I submit that without at least some kind of attempt to
> > avoid deadlocks and spurious errors there, it's not really a usable
> > scheme, and that seems hard.
>
> I was thinking that for dynamic creation, there would be a DDL command to
> create the necessary partitions:
>
> -- Creates 2021-01-02, unless the month already exists:
> ALTER TABLE bydate SET GRANULARITY='1day';
> ALTER TABLE bydate CREATE PARTITION FOR VALUE ('2021-01-02');

Well, that dodges the deadlock issue with doing it implicitly, but it
also doesn't seem to offer a lot of value over just creating the
partitions in a fully manual way. I mean you could just say:

CREATE TABLE bydate_2021_02_02 PARTITION OF bydate FOR VALUES FROM
('2021-01-02') TO ('2021-02-03');

It's longer, but it's not really that bad.

-- 
Robert Haas
EDB: http://www.enterprisedb.com





view thread (38+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Automatic HASH and LIST partition creation
  In-Reply-To: <CA+TgmoatUTK+MODYF3F1Fb_LH77b2dn0d8F1C3tfyTF66tWbhw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox