<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Wishlist of PL/Perl Enhancements for PostgreSQL 8.5</title>
	<atom:link href="http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/</link>
	<description>Listen. Reflect. Explore. Solve.</description>
	<lastBuildDate>Sun, 14 Apr 2013 08:36:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Shahaf Abileah</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-2494</link>
		<dc:creator><![CDATA[Shahaf Abileah]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 21:29:03 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-2494</guid>
		<description><![CDATA[Thanks Tim!

I dug in deeper and discovered that the majority of the overhead was attributed to a single line of Perl code used to deserialize the json string into an object.  I then discovered the JSON::XS library which reduced the cost dramatically.  It appears that in my case the overhead of calling plperl is insignificant compared to the cost of the actual work I&#039;m doing in the plperl function.]]></description>
		<content:encoded><![CDATA[<p>Thanks Tim!</p>
<p>I dug in deeper and discovered that the majority of the overhead was attributed to a single line of Perl code used to deserialize the json string into an object.  I then discovered the JSON::XS library which reduced the cost dramatically.  It appears that in my case the overhead of calling plperl is insignificant compared to the cost of the actual work I&#8217;m doing in the plperl function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-2493</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 21:23:17 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-2493</guid>
		<description><![CDATA[Yes, there are some plperl performance improvements in Postgres 9.x. You&#039;ll also get more performance by using a Perl that was configured without threads (you may have to build and install a separate perl for that and then configure a build PostgreSQL to use that). Neither will &quot;solve&quot; the overhead, but they&#039;ll reduce it.

You should also ask for help on the pgsql-performance mailing list (after searching the archives http://archives.postgresql.org/pgsql-performance/)

Good luck.]]></description>
		<content:encoded><![CDATA[<p>Yes, there are some plperl performance improvements in Postgres 9.x. You&#8217;ll also get more performance by using a Perl that was configured without threads (you may have to build and install a separate perl for that and then configure a build PostgreSQL to use that). Neither will &#8220;solve&#8221; the overhead, but they&#8217;ll reduce it.</p>
<p>You should also ask for help on the pgsql-performance mailing list (after searching the archives <a href="http://archives.postgresql.org/pgsql-performance/" rel="nofollow">http://archives.postgresql.org/pgsql-performance/</a>)</p>
<p>Good luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shahaf Abileah</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-2492</link>
		<dc:creator><![CDATA[Shahaf Abileah]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 17:28:34 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-2492</guid>
		<description><![CDATA[Do you know whether there are any plperl performance improvements in Postgres 9.x?

I&#039;m running an experiment where I store json data in a big (~5KB) text column in Postgres.  I wrote functions using plperlu to extract values out of the json using jsonpath expressions (making use of existing json and jsonpath libraries for Perl).  I then created functional indexes (using these functions) to avoid having to actually run the functions at query-time (as long as the query has a matching expression).  It all works, but performance is not where I&#039;d like it to be.  In my test setup it takes ~2 ms to insert the large record.  If I add one functional index, it takes ~11 ms.  If I add two indexes, it takes ~19 ms.  In other words, it takes about 8 ms for each execution of the plperl function.  If migrating to 9.x would solve this overhead, awesome.  If not, I wonder: are any standard ways to tune or analyze plperl functions?

thanks!

--S]]></description>
		<content:encoded><![CDATA[<p>Do you know whether there are any plperl performance improvements in Postgres 9.x?</p>
<p>I&#8217;m running an experiment where I store json data in a big (~5KB) text column in Postgres.  I wrote functions using plperlu to extract values out of the json using jsonpath expressions (making use of existing json and jsonpath libraries for Perl).  I then created functional indexes (using these functions) to avoid having to actually run the functions at query-time (as long as the query has a matching expression).  It all works, but performance is not where I&#8217;d like it to be.  In my test setup it takes ~2 ms to insert the large record.  If I add one functional index, it takes ~11 ms.  If I add two indexes, it takes ~19 ms.  In other words, it takes about 8 ms for each execution of the plperl function.  If migrating to 9.x would solve this overhead, awesome.  If not, I wonder: are any standard ways to tune or analyze plperl functions?</p>
<p>thanks!</p>
<p>&#8211;S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NYTProf v4 &#8211; Now with string-eval x-ray vision! &#171; Not this&#8230;</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1628</link>
		<dc:creator><![CDATA[NYTProf v4 &#8211; Now with string-eval x-ray vision! &#171; Not this&#8230;]]></dc:creator>
		<pubDate>Wed, 09 Jun 2010 19:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1628</guid>
		<description><![CDATA[[...] those months I&#8217;d also started working on enhancements for PostgreSQL PL/Perl. That project turned into something of an epic adventure with more than its fair share of highs and [...]]]></description>
		<content:encoded><![CDATA[<p>[...] those months I&#8217;d also started working on enhancements for PostgreSQL PL/Perl. That project turned into something of an epic adventure with more than its fair share of highs and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1540</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Fri, 26 Mar 2010 11:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1540</guid>
		<description><![CDATA[It would be interesting and useful to add, but it&#039;s probably quite a lot of work.]]></description>
		<content:encoded><![CDATA[<p>It would be interesting and useful to add, but it&#8217;s probably quite a lot of work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Bartunov</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1539</link>
		<dc:creator><![CDATA[Oleg Bartunov]]></dc:creator>
		<pubDate>Fri, 26 Mar 2010 10:39:48 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1539</guid>
		<description><![CDATA[Did you consider support of pg&#039;s internal type in perl ? I imagine a lot of people will benefit writing support functions for new operators, instead of using C.]]></description>
		<content:encoded><![CDATA[<p>Did you consider support of pg&#8217;s internal type in perl ? I imagine a lot of people will benefit writing support functions for new operators, instead of using C.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1303</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Wed, 07 Oct 2009 22:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1303</guid>
		<description><![CDATA[I see your point. What&#039;s needed is some equivalent of a &quot;use&quot; statement that can be put at the start of plperl functions. I have a few ideas - I&#039;ll give it some thought. Thanks.]]></description>
		<content:encoded><![CDATA[<p>I see your point. What&#8217;s needed is some equivalent of a &#8220;use&#8221; statement that can be put at the start of plperl functions. I have a few ideas &#8211; I&#8217;ll give it some thought. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Eisentraut</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1302</link>
		<dc:creator><![CDATA[Peter Eisentraut]]></dc:creator>
		<pubDate>Wed, 07 Oct 2009 12:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1302</guid>
		<description><![CDATA[Item 1 could be controversial.  It&#039;s undoubtedly useful, but it creates an action at a distance that effectively invites users to create mutually incompatible PL/Perl installation.  Ideally, you would want users to create libraries of reusable PL/Perl functions, but when those only work with certain at_init_do settings, then you create a big mess.  Look at PHP; they have done something quite similar with their php.ini.]]></description>
		<content:encoded><![CDATA[<p>Item 1 could be controversial.  It&#8217;s undoubtedly useful, but it creates an action at a distance that effectively invites users to create mutually incompatible PL/Perl installation.  Ideally, you would want users to create libraries of reusable PL/Perl functions, but when those only work with certain at_init_do settings, then you create a big mess.  Look at PHP; they have done something quite similar with their php.ini.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1298</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Tue, 06 Oct 2009 20:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1298</guid>
		<description><![CDATA[Suggested change: rename plperl.at_init_do to plperl.at_perl_init_do and add plperl.at_safe_init_do which would be similar but specify code to run when the Safe compartment is initialized. It could thus be set by per-user/per-role GUC.]]></description>
		<content:encoded><![CDATA[<p>Suggested change: rename plperl.at_init_do to plperl.at_perl_init_do and add plperl.at_safe_init_do which would be similar but specify code to run when the Safe compartment is initialized. It could thus be set by per-user/per-role GUC.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1296</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Tue, 06 Oct 2009 20:03:15 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1296</guid>
		<description><![CDATA[It&#039;s not fixed in 5.10.1. I&#039;ve asked for an update on the status. Meanwhile I&#039;ve added a comment on the ticket with a simple workaround that would be effective for plperl and that I&#039;ll include in my changes.]]></description>
		<content:encoded><![CDATA[<p>It&#8217;s not fixed in 5.10.1. I&#8217;ve asked for an update on the status. Meanwhile I&#8217;ve added a comment on the ticket with a simple workaround that would be effective for plperl and that I&#8217;ll include in my changes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew G.</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1293</link>
		<dc:creator><![CDATA[Andrew G.]]></dc:creator>
		<pubDate>Tue, 06 Oct 2009 12:31:29 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1293</guid>
		<description><![CDATA[Points 1-3 are primarily attempts to work around the lack of features that should have been in Safe.pm in the first place.

For comparison, in TCL if you create a safe interpreter using ::safe::interpCreate, then the safe interpreter can load modules etc. in the normal way, subject to (a) the specified mapping between host filenames and the virtual filenames seen inside the safe interpreter, and (b) the fact that the loaded modules are still running inside the safe interpreter and have no more access than it does.

A proper system of external interfaces for Safe would obviate the need for many of the features you are requesting.

Incidentally, is the sort{} + threads + Safe bug (#60374) fixed yet? (and if it is, why is it still open?)]]></description>
		<content:encoded><![CDATA[<p>Points 1-3 are primarily attempts to work around the lack of features that should have been in Safe.pm in the first place.</p>
<p>For comparison, in TCL if you create a safe interpreter using ::safe::interpCreate, then the safe interpreter can load modules etc. in the normal way, subject to (a) the specified mapping between host filenames and the virtual filenames seen inside the safe interpreter, and (b) the fact that the loaded modules are still running inside the safe interpreter and have no more access than it does.</p>
<p>A proper system of external interfaces for Safe would obviate the need for many of the features you are requesting.</p>
<p>Incidentally, is the sort{} + threads + Safe bug (#60374) fixed yet? (and if it is, why is it still open?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1291</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Tue, 06 Oct 2009 08:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1291</guid>
		<description><![CDATA[Thank you, yes, I mean at the end of the process. I&#039;m not sure what you mean by &quot;Most of the rest of your points would be better addressed at the perl level&quot;.]]></description>
		<content:encoded><![CDATA[<p>Thank you, yes, I mean at the end of the process. I&#8217;m not sure what you mean by &#8220;Most of the rest of your points would be better addressed at the perl level&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zbigniew Lukasiak</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1290</link>
		<dc:creator><![CDATA[Zbigniew Lukasiak]]></dc:creator>
		<pubDate>Tue, 06 Oct 2009 08:01:25 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1290</guid>
		<description><![CDATA[I don&#039;t have anything smart to write here - but I wanted to express my support, especially for the point 1 above. It was a long time ago that I learned about PL/Perl and I was initially thrilled about the possibilities - but after I learned about the constraints for loading modules I realized that it&#039;s application is very limited.]]></description>
		<content:encoded><![CDATA[<p>I don&#8217;t have anything smart to write here &#8211; but I wanted to express my support, especially for the point 1 above. It was a long time ago that I learned about PL/Perl and I was initially thrilled about the possibilities &#8211; but after I learned about the constraints for loading modules I realized that it&#8217;s application is very limited.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew G.</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comment-1288</link>
		<dc:creator><![CDATA[Andrew G.]]></dc:creator>
		<pubDate>Tue, 06 Oct 2009 04:08:48 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344#comment-1288</guid>
		<description><![CDATA[&lt;blockquote&gt;
Currently PostgreSQL doesn’t execute END blocks at server shutdown 
&lt;/blockquote&gt;

You do realize that this would be impossible, right? That interpreters are created &lt;i&gt;per-connection&lt;/i&gt; and no interpreter state can be preserved past the end of the session (each session is a separate process)?

Most of the rest of your points would be better addresses at the perl level (Safe is a joke compared to, for example, TCL&#039;s safe interpreters).]]></description>
		<content:encoded><![CDATA[<blockquote><p>
Currently PostgreSQL doesn’t execute END blocks at server shutdown
</p></blockquote>
<p>You do realize that this would be impossible, right? That interpreters are created <i>per-connection</i> and no interpreter state can be preserved past the end of the session (each session is a separate process)?</p>
<p>Most of the rest of your points would be better addresses at the perl level (Safe is a joke compared to, for example, TCL&#8217;s safe interpreters).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
