Re: Add pgstathashindex() to get hash index table statistics.

From: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add pgstathashindex() to get hash index table statistics.
Date: 2017-01-24 11:36:03
Message-ID: CAGz5QCJpySmvSfa3_b26rb_Q_dQ4dyrSCXZgaskY3ruLznYJpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 24, 2017 at 10:09 AM, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com> wrote:
>> I've looked at the patch. It looks good. However, I was wondering why
>> an exclusive lock for extension is necessary for reading the number
>> blocks in this case. Please refer to the following code.
>>
>> + /* Get the current relation length */
>> + LockRelationForExtension(rel, ExclusiveLock);
>> + nblocks = RelationGetNumberOfBlocks(rel);
>> + UnlockRelationForExtension(rel, ExclusiveLock);
>>
>> Apart from this, I've nothing else to add.
>
>
> Actually in my case I may not need to acquire ExclusiveLock just to
> get the number of pages in a relation. Infact I have already opened a
> relation using
> 'AccessShareLock' which should be enough to read a table length.
> Thanks for putting this point. I have corrected it in the attached v5
> patch.
I've checked the last attached patch and didn't find any issue. There
is no problem with patching and compilation. It also passed all
regression tests.
Nothing else to add from my side. I'm marking this 'Ready for commiter'.

--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2017-01-24 11:36:36 Re: Failure in commit_ts tap tests
Previous Message Andrew Borodin 2017-01-24 11:18:46 Re: Review: GIN non-intrusive vacuum of posting tree