From: | Ildus Kurbangaliev <i(dot)kurbangaliev(at)postgrespro(dot)ru> |
---|---|
To: | Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> |
Cc: | andres(at)anarazel(dot)de, pgsql-hackers(at)postgresql(dot)org, robertmhaas(at)gmail(dot)com, aekorotkov(at)gmail(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, amit(dot)kapila16(at)gmail(dot)com |
Subject: | Re: RFC: replace pg_stat_activity.waiting with something more descriptive |
Date: | 2015-07-23 09:06:01 |
Message-ID: | 55B0AE79.8090805@postgrespro.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 07/23/2015 05:57 AM, Kyotaro HORIGUCHI wrote:
> At Wed, 22 Jul 2015 17:50:35 +0300, Ildus Kurbangaliev<i(dot)kurbangaliev(at)postgrespro(dot)ru> wrote in<55AFADBB(dot)9090203(at)postgrespro(dot)ru>
>> >On 07/22/2015 09:10 AM, Kyotaro HORIGUCHI wrote:
>>> > >Hello,
>>> > >
>>> > >At Tue, 21 Jul 2015 14:28:25 +0300, Ildus Kurbangaliev
>>> > ><i(dot)kurbangaliev(at)postgrespro(dot)ru> wrote in
>>> > ><55AE2CD9(dot)4050005(at)postgrespro(dot)ru>
>>>> > >>On 07/21/2015 01:18 PM, Andres Freund wrote:
>>>>> > >>>I'd very much like to avoid increasing the size of struct LWLock. We
>>>>> > >>>have a lot of those and I'd still like to inline them with the buffer
>>>>> > >>>descriptors. Why do we need a separate group and can't reuse the
>>>>> > >>>tranche? That might require creating a few more tranches, but ...?
>>>>> > >>>
>>>>> > >>>Andres
>>>> > >>Do you mean moving LWLocks defined by offsets and with dynamic sizes
>>>> > >>to separate tranches?
>>> > >I think it is too much for the purpose. Only two new tranches and
>>> > >maybe one or some new members (maybe representing the group) of
>>> > >trances will do, I suppose.
>> >
>> >Can you explain why only two new tranches?
>> >There is 13 types of lwlocks (besides individual), and we need
>> >separate them somehow.
> Sorry, I minunderstood about tranche.
>
> Currently tranches other than main are used by WALInsertLocks and
> ReplicationOrigins. Other "dynamic locks" are defined as parts of
> main LWLokcs since they have the same shape with individual
> lwlocks. Leaving the individual locks, every lock groups may have
> their own tranche if we allow lwlocks to have own tranche even if
> it is in MainLWLockArray. New 13-16 trances will be added but no
> need to register their name in LWLOCK_GROUPS[]. After all, this
> array would be renamed such as "IndividualLWLockNames" and the
> name-lookup can be done by the follwoing simple steps.
>
> - If the the lock is in main tranche, lookup the individual name
> array for its name.
>
> - Elsewise, use the name of its tranche.
>
> Does this make sense?
>
Yes, this is exactly how I see it too. We keep MainLWLockArray, and
create 16 tranches.
Only problem is here that dynamic lwlocks allocated with LWLockAssign,
and for some of cases
we need to pass `tranche_id` to place where it is called (for example
async.c -> slru.c)
--
Ildus Kurbangaliev
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
From | Date | Subject | |
---|---|---|---|
Next Message | Teodor Sigaev | 2015-07-23 09:18:01 | Re: compress method for spgist - 2 |
Previous Message | Simon Riggs | 2015-07-23 08:52:33 | Re: WAL logging problem in 9.4.3? |