Thread: Transactions to create pg_multixact members and offsets

Transactions to create pg_multixact members and offsets

From
Dev Kumkar
Date:
Hellos,

How to manually increase pg_multixact members and offsets?

Does a transaction waiting for exclusive lock or shared lock result into entry being created in pg_multixact?

Excerpt of multixact.c:
/*-------------------------------------------------------------------------
2  *
3  * multixact.c
4  * PostgreSQL multi-transaction-log manager
5  *
6  * The pg_multixact manager is a pg_clog-like manager that stores an array of
7  * MultiXactMember for each MultiXactId. It is a fundamental part of the
8  * shared-row-lock implementation.

Regards...

Re: Transactions to create pg_multixact members and offsets

From
Alvaro Herrera
Date:
Dev Kumkar wrote:
> Hellos,
>
> How to manually increase pg_multixact members and offsets?

Search for "burnmulti" in the archives, which is a contrib module to
test pg_multixact.

> Does a transaction waiting for exclusive lock or shared lock result into
> entry being created in pg_multixact?

Merely waiting does not, but more than one lock being acquired on a
tuple does cause a multixact to be created.  Try SELECT FOR SHARE on two
transactions on the same tuple.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


Re: Transactions to create pg_multixact members and offsets

From
Dev Kumkar
Date:
On Thu, Nov 20, 2014 at 11:15 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
Search for "burnmulti" in the archives, which is a contrib module to
test pg_multixact.
Thanks, got some links. Will give a try and get back.

Merely waiting does not, but more than one lock being acquired on a
tuple does cause a multixact to be created.  Try SELECT FOR SHARE on two
transactions on the same tuple.
Sure.
Also what if there are only inserts/updates which transaction have and there are no explicit select queries?

Regards...

Re: Transactions to create pg_multixact members and offsets

From
Alvaro Herrera
Date:
Dev Kumkar wrote:
> On Thu, Nov 20, 2014 at 11:15 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
> wrote:

> > Merely waiting does not, but more than one lock being acquired on a
> > tuple does cause a multixact to be created.  Try SELECT FOR SHARE on two
> > transactions on the same tuple.
>
> Sure.
> Also what if there are only inserts/updates which transaction have and
> there are no explicit select queries?

If there are foreign keys on the tables, the system internally runs some
SELECT FOR KEY SHARE queries on the referenced tables (the ones
containing the primary or unique keys).  You can get some multixacts
that way too.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


Re: Transactions to create pg_multixact members and offsets

From
Dev Kumkar
Date:
On Fri, Nov 21, 2014 at 1:14 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

If there are foreign keys on the tables, the system internally runs some
SELECT FOR KEY SHARE queries on the referenced tables (the ones
containing the primary or unique keys).  You can get some multixacts
that way too.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Thanks !

If I recollect correct, then is the cleanup of pg_multixact/members fixed in 9.3.5 release?

Regards...