Re: Deadlock risk while inserting directly into partition?

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Deadlock risk while inserting directly into partition?
Date: 2021-06-26 04:41:40
Message-ID: 20210626044140.GQ29179@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 24, 2021 at 10:27:06AM +1200, David Rowley wrote:
> I think the reasons for doing operations directly on partitions are
> being reduced with each release. What operations do people really
> need to do on partitions now? TRUNCATE is probably one, maybe there's
> still a need to CREATE INDEX.

We always SELECT out of parent tables, but need to be able to CREATE INDEX on
partitions.

And INSERT ON CONFLICT into partitions, as we don't have nor want partitioned
indexes, for several reasons. Same for row triggers. One reason is that we
still support inheritence tables, and it's better if we can deal with both
types of child tables the same way. That neither DETACH nor NO INHERIT grammar
supports both is arguably a wart, as it requires our library to check the
relkind. Another reason is that our unique indexes are large - they're across
multiple columns, sometimes text columns, and we don't need them except to
support upsert, so they're pruned when the table is no longer "recent".

Partitions have to be manually created and dropped, so applications already
have to deal with partitions, and it's not surprising if they interact with
them in other ways, too. Partitions can themselves be partitioned, which also
need to be accessed directly.

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2021-06-26 05:42:07 Re: Some incorrect logs in TAP tests of pgbench
Previous Message Michael Paquier 2021-06-26 03:50:24 Re: Some incorrect logs in TAP tests of pgbench