Re: Possible micro-optimization in CacheInvalidateHeapTuple

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

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-10-14 01:31:56 Re: Incorrect initialization of sentPtr in walsender.c
Previous Message Michael Paquier 2014-10-14 01:22:11 Re: pg_get_indexdef() doesn't quote string reloptions