Re: Partitioned tables and locks - Mailing list pgsql-general

From James Sewell
Subject Re: Partitioned tables and locks
Date
Msg-id CAANVwEvXZ40q2yYYKmz1eXNKybK6s2yhOzhid4DbGma4HeEvkw@mail.gmail.com
Whole thread Raw
In response to Re: Partitioned tables and locks  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Partitioned tables and locks
List pgsql-general


> 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.)

The queries were just select count(*) both with a where clause which excludes some partitions and without, I’m on 11.

The table has over 3K partitions 


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

It’s 256 at the moment, with 600 connections - guess I need more.
--
James Sewell,
Chief Architect

Suite 112, Jones Bay Wharf, 26-32 Pirrama Road, Pyrmont NSW 2009
P (+61) 2 8099 9000  W www.jirotech.com  F (+61) 2 8099 9099


The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.

pgsql-general by date:

Previous
From: Steven Winfield
Date:
Subject: RE: Row locks, SKIP LOCKED, and transactions
Next
From: James Sewell
Date:
Subject: Re: Max locks