Re: Partitioned tables and locks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Sewell <james(dot)sewell(at)jirotech(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Partitioned tables and locks
Date: 2019-12-19 13:38:36
Message-ID: 6714.1576762716@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

James Sewell <james(dot)sewell(at)jirotech(dot)com> writes:
> Is it expected that a lock on a partitioned table will take out 2 locks per
> child regardless of the number of children which are excluded at plan time?

Depends on the details of your query, and on which PG version you're
using, but it's by no means surprising for each child table to get
locked. (I'm not sure where *two* locks would come from, though.)

If you're working with massively partitioned tables, increasing
max_locks_per_transaction is a good idea.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Maksim Milyutin 2019-12-19 13:58:37 Re: Commit to primary with unavailable sync standby
Previous Message Fabio Ugo Venchiarutti 2019-12-19 12:54:26 Re: Commit to primary with unavailable sync standby