Re: Partitioned tables and locks

2019-12-19 Thread Michael Lewis
I don't recall the details, but I know v12 included significant enhancements to lock relations later in the process such that when targeting relatively few of the partitions, it can be a major performance boost.

Re: Partitioned tables and locks

2019-12-19 Thread James Sewell
> 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

Re: Partitioned tables and locks

2019-12-19 Thread Tom Lane
James Sewell 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 chi

Partitioned tables and locks

2019-12-19 Thread James Sewell
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? For example I can select count(*) from a table with 3500 partitions in transaction, and see 7000 AccessShareLocks show up till I finish the transa