Re: Reduce the memcpy call from SearchCatCache

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Atsushi Ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Reduce the memcpy call from SearchCatCache
Date: 2009-07-07 14:22:06
Message-ID: 6020.1246976526@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Atsushi Ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp> writes:
> Tom Lane writes:
>> There are cases where cache lookups happen recursively.

> I tested regression test and pgbench. However, I did not consider
> recursive case. I revised a patch for safe recursive call.
> But I cannot find test case in which recursive call happens.

Try turning on CLOBBER_CACHE_ALWAYS or CLOBBER_CACHE_RECURSIVELY to
get a demonstration of what can happen under the right conditions.

I think the only really safe way to do what you propose would be to
refactor the ScanKey API to separate the datum values and is-null
flags from the more static parts of the data structure. That would
be a pretty large/invasive patch, and the numbers cited here don't
seem to me to justify the work. It's even possible that it could
end up being a net performance loss due to having to pass around more
pointers :-(

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-07-07 14:28:24 Re: Small foreign key error message improvement
Previous Message Atsushi Ogawa 2009-07-07 13:03:11 Re: Reduce the memcpy call from SearchCatCache