Skip site navigation (1) Skip section navigation (2)

Re: Storing hot members of PGPROC out of the band

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Storing hot members of PGPROC out of the band
Date: 2011-11-03 22:43:15
Message-ID: CA+U5nMLJ-=nmrPnZEOb=HnsSmQg0VuQYzG+XDwYn3CmtX+drRA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Nov 3, 2011 at 6:12 PM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Josh BerkusDate: 2011-11-03 23:06:16
Subject: Re: Online base backup from the hot-standby
Previous:From: Alvaro HerreraDate: 2011-11-03 22:36:03
Subject: isolationtester patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group