James Sewell <james.sewell@xxxxxxxxxxxx> 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