OverrideSearchPathMatchesCurrent performance improvement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: OverrideSearchPathMatchesCurrent performance improvement
Date: 2014-11-27 20:41:46
Message-ID: 15447.1417120906@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The other thing that emerged from
http://www.postgresql.org/message-id/flat/CAOR=d=3j1U_q-zf8+jUx1hkx8ps+N8pm=EUTqyFdJ5ov=+fawg(at)mail(dot)gmail(dot)com
is that for workloads like this, OverrideSearchPathMatchesCurrent is
a bottleneck: it's part of the code path needed to re-use a cached plan,
and this example is doing a lot of that. The original implementation
of that function followed the KISS principle, since I thought it probably
wouldn't be a bottleneck. Now that that's proven wrong, I offer the
attached reimplementation, which saves about 9% of overall runtime on
Scott's example by avoiding palloc/pfree traffic. It knows a lot more
about the relation of override search paths to active search paths than
it did before; but the adjacent functions know these things too, so it
doesn't seem like much of a loss from a maintainability standpoint.

regards, tom lane

Attachment Content-Type Size
faster-OverrideSearchPathMatchesCurrent.patch text/x-diff 1.8 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2014-11-27 20:47:46 Re: no test programs in contrib
Previous Message Michael Paquier 2014-11-27 20:30:04 Re: [REVIEW] Re: Compression of full-page-writes