Re: Possible micro-optimization in CacheInvalidateHeapTuple - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Possible micro-optimization in CacheInvalidateHeapTuple
Date
Msg-id 14380.1413250091@sss.pgh.pa.us
Whole thread Raw
In response to Possible micro-optimization in CacheInvalidateHeapTuple  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: Possible micro-optimization in CacheInvalidateHeapTuple
List pgsql-hackers
Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
> CacheInvalidateHeapTuple currently does the following tests first; would there be a performance improvement to
testingthe system relation case first? We're almost never in bootstrap mode, so that test is almost always a waste. Is
thereany 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.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_get_indexdef() doesn't quote string reloptions
Next
From: Michael Paquier
Date:
Subject: Re: Incorrect initialization of sentPtr in walsender.c