Re: Storing hot members of PGPROC out of the band - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Storing hot members of PGPROC out of the band
Date
Msg-id CA+U5nMLJ-=nmrPnZEOb=HnsSmQg0VuQYzG+XDwYn3CmtX+drRA@mail.gmail.com
Whole thread Raw
In response to Storing hot members of PGPROC out of the band  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Responses Re: Storing hot members of PGPROC out of the band
Re: Storing hot members of PGPROC out of the band
List pgsql-hackers
On Thu, Nov 3, 2011 at 6:12 PM, Pavan Deolasee <pavan.deolasee@gmail.com> wrote:

> When PGPROC array is allocated, we also allocate another array of
> PGPROC_MINIMAL structures of the same size. While accessing the
> ProcArray, a simple pointer mathematic can get us the corresponding
> PGPROC_MINIMAL structure. The only exception being the dummy PGPROC
> for prepared transaction. A first cut version of the patch is
> attached. It looks big, but most of the changes are cosmetic because
> of added indirection. The patch also contains another change to keep
> the ProcArray sorted by (PGPROC *) to preserve locality of references
> while traversing the array.

This is very good.

If you look at your PGPROC_MINIMAL, its mostly transaction related
stuff, so I would rename it PGXACT or similar. Not sure why you talk
about pointer math, seems easy enough just to have two arrays
protected by one lock, and have each proc use the same offset in both
arrays.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: isolationtester patch
Next
From: Josh Berkus
Date:
Subject: Re: Online base backup from the hot-standby