Re: Possible micro-optimization in CacheInvalidateHeapTuple

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible micro-optimization in CacheInvalidateHeapTuple
Date: 2014-10-22 00:06:41
Message-ID: 5446F511.60603@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/13/14, 8:28 PM, Tom Lane wrote:
> Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> writes:
>> CacheInvalidateHeapTuple currently does the following tests first; would there be a performance improvement to testing the system relation case first? We're almost never in bootstrap mode, so that test is almost always a waste. Is there any reason not to switch the two?
>> /* Do nothing during bootstrap */
>> if (IsBootstrapProcessingMode())
>> return;
>
>> /*
>> * We only need to worry about invalidation for tuples that are in system
>> * relations; user-relation tuples are never in catcaches and can't affect
>> * the relcache either.
>> */
>> if (!IsSystemRelation(relation))
>> return;
>
> You're assuming that IsSystemRelation() is safe to apply during bootstrap
> mode. Even if it is, I don't see the point of messing with this.
> IsBootstrapProcessingMode() is a macro expanding to one comparison
> instruction.

Comment patch to that effect attached.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

Attachment Content-Type Size
patch text/plain 606 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-10-22 00:43:20 Re: wal-size limited to 16MB - Performance issue for subsequent backup
Previous Message Tom Lane 2014-10-21 23:05:23 Re: Proposal: Log inability to lock pages during vacuum