<?xml version="1.0"?>
<rss version="2.0">

<channel>
	<title>..::Planet PostgreSQL::..</title>
	<link>http://www.planetpostgresql.org/</link>
	<language>en</language>
	<description>..::Planet PostgreSQL::.. - http://www.planetpostgresql.org/</description>

<item>
	<title>Peter Eisentraut: Where have all the translations gone?</title>
	<guid>http://petereisentraut.blogspot.com/2009/07/where-have-all-translations-gone.html</guid>
	<link>http://petereisentraut.blogspot.com/2009/07/where-have-all-translations-gone.html</link>
	<description>&lt;a href=&quot;http://1.bp.blogspot.com/_dgdplFJMdoQ/SkrgqGL0WGI/AAAAAAAAABs/1NC8XNN2I0c/s1600-h/kbabel-256.png&quot;&gt;&lt;img src=&quot;http://1.bp.blogspot.com/_dgdplFJMdoQ/SkrgqGL0WGI/AAAAAAAAABs/1NC8XNN2I0c/s400/kbabel-256.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5353338120902563938&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;If you have downloaded PostgreSQL 8.4.0 and are wondering where so many of the translations have gone: The translation team has &lt;a href=&quot;http://lists.pgfoundry.org/pipermail/pgtranslation-translators/2009-March/000146.html&quot;&gt;decided&lt;/a&gt; not to ship translations anymore that are not translated at least about 80%. (See the &lt;a href=&quot;http://archives.postgresql.org/pgsql-committers/2009-06/msg00360.php&quot;&gt;commit message&lt;/a&gt; for the list of victims.) This is so that incidental users of stale translations are not presented with a confusing and distracting mix of translated and untranslated messages all the time. So right now we are only shipping a full or almost full set of translations into German, Spanish, French, Japanese, Portuguese, and Turkish.&lt;br /&gt;&lt;br /&gt;To get the translations into other languages back into the release, go to &lt;a href=&quot;http://babel.postgresql.org/&quot;&gt;http://babel.postgresql.org/&lt;/a&gt; and start submitting updates.  Updates may be included as early as release 8.4.1 in a few months.&lt;br /&gt;&lt;br /&gt;I hope in particular that we might get the Chinese, Italian, and Russian translations back into shape.&lt;br /&gt;&lt;br /&gt;By the way, if you want to start (or continue) translating, I suggest that you approximately follow this priority order: libpq, psql, pgscripts, pg_dump, initdb, postgres. This or a similar order will make the translations useful to the most users with the least amount of work.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5541296000399974369-1452563363527277379?l=petereisentraut.blogspot.com&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Thu, 02 Jul 2009 20:00:06 +0000</pubDate>
	<author>peter_e@gmx.net (Peter Eisentraut)</author>
</item>
<item>
	<title>Robert Gravsjö: Finally a real world webservice that enterprises can use to save money</title>
	<guid>http://postgresql.blogg.se/2009/july/finally-a-real-world-webservice-that-enterpri.html</guid>
	<link>http://postgresql.blogg.se/2009/july/finally-a-real-world-webservice-that-enterpri.html</link>
	<description>Meet the Meeting Ticker.</description>
	<pubDate>Thu, 02 Jul 2009 11:17:42 +0000</pubDate>
</item>
<item>
	<title>Robert Gravsjö: &quot;No to SQL&quot;</title>
	<guid>http://postgresql.blogg.se/2009/july/no-to-sql.html</guid>
	<link>http://postgresql.blogg.se/2009/july/no-to-sql.html</link>
	<description>Every time I see something or hear something like this I sigh a little bit. Not only when it's related to SQL but in the world of computer professionals in general. &quot;The right tool for the job&quot; seems to be a hard concept to understand sometimes. I wonder ...</description>
	<pubDate>Thu, 02 Jul 2009 08:54:26 +0000</pubDate>
</item>
<item>
	<title>David Wheeler: Committed: pgTAP Result Set Assertion Functions</title>
	<guid>http://feedproxy.google.com/~r/justatheory/pgsum/~3/xEMuvLCWZtg/results_eq.html</guid>
	<link>http://feedproxy.google.com/~r/justatheory/pgsum/~3/xEMuvLCWZtg/results_eq.html</link>
	<description>&lt;div&gt;&lt;p&gt;Regular readers will know that I've been thinking a lot about
&lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/comparing-relations.html&quot; title=&quot;Thoughts on Testing SQL Result Sets&quot;&gt;testing SQL result sets&lt;/a&gt; and
how to &lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/result-testing-function-names.html&quot; title=&quot;Need Help Naming Result Set Testing Functions&quot;&gt;how to name result testing functions&lt;/a&gt;,
and various &lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/set_testing_update.html&quot; title=&quot;pgTAP Set-Testing Update&quot;&gt;implementation issues&lt;/a&gt;. I am very happy
to say that I've now committed the first three such test functions to the
&lt;a href=&quot;http://github.com/theory/pgtap/tree/master/&quot; title=&quot;Get the pgTAP source on GitHub&quot;&gt;Git repository&lt;/a&gt;. They've been tested
on 8.4 and 8.3. Here's what I came up with.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/results_eq.html&quot;&gt;Read More »&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/justatheory/pgsum/~4/xEMuvLCWZtg&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Wed, 01 Jul 2009 21:32:00 +0000</pubDate>
</item>
<item>
	<title>David Fetter: WITH (so much drama in the CTE)</title>
	<guid>http://people.planetpostgresql.org/dfetter/index.php?/archives/22-WITH-so-much-drama-in-the-CTE.html</guid>
	<link>http://people.planetpostgresql.org/dfetter/index.php?/archives/22-WITH-so-much-drama-in-the-CTE.html</link>
	<description>By now, you've probably seen that PostgreSQL 8.4 can produce Mandelbrot sets&lt;br /&gt;
like the one below, but what are Common Table Expressions &lt;strong&gt;really&lt;/strong&gt; about?&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://people.planetpostgresql.org/dfetter/index.php?/archives/22-WITH-so-much-drama-in-the-CTE.html#extended&quot;&gt;Continue reading &quot;WITH (so much drama in the CTE)&quot;&lt;/a&gt;</description>
	<pubDate>Wed, 01 Jul 2009 17:18:57 +0000</pubDate>
	<author>nospam@example.com (David Fetter)</author>
</item>
<item>
	<title>Andreas Scherbaum: PostgreSQL 8.4: Column Permissions</title>
	<guid>http://andreas.scherbaum.la/blog/archives/577-PostgreSQL-8.4-Column-Permissions.html</guid>
	<link>http://andreas.scherbaum.la/blog/archives/577-PostgreSQL-8.4-Column-Permissions.html</link>
	<description>&lt;div class=&quot;serendipity_authorpic&quot;&gt;&lt;img src=&quot;http://andreas.scherbaum.la/blog/templates/default/img/Andreas__ads__Scherbaum.jpg&quot; alt=&quot;Author&quot; title=&quot;Andreas 'ads' Scherbaum&quot; /&gt;&lt;br /&gt;&lt;span&gt;Andreas 'ads' Scherbaum&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;font&gt;Up to &lt;a target=&quot;_blank&quot; href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7073&amp;amp;entry_id=577&quot; title=&quot;http://www.postgresql.org/&quot;&gt;&lt;em&gt;PostgreSQL&lt;/em&gt;&lt;/a&gt; 8.3 it was only possible to &lt;a target=&quot;_blank&quot; href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7074&amp;amp;entry_id=577&quot; title=&quot;http://www.postgresql.org/docs/8.3/static/sql-grant.html&quot;&gt;grant&lt;/a&gt; (and &lt;a target=&quot;_blank&quot; href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7075&amp;amp;entry_id=577&quot; title=&quot;http://www.postgresql.org/docs/8.3/static/sql-revoke.html&quot;&gt;revoke&lt;/a&gt;) permissions on the entire table. If column level permissions were needed, a workaround like a &lt;a target=&quot;_blank&quot; href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7076&amp;amp;entry_id=577&quot; title=&quot;http://www.postgresql.org/docs/8.4/static/sql-createview.html&quot;&gt;view&lt;/a&gt; solved &lt;/font&gt;&lt;font&gt;(more or less) &lt;/font&gt;&lt;font&gt;the problem: create the view with the required (allowed) columns, revoke all permissions from the underlaying table, grant permissions to the view.&lt;/font&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;font&gt;This - of course - is uneloquent, error prone and does not scale well. For different users requiring access to different columns, a big number of views is needed.&lt;/font&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;font&gt;&lt;em&gt;PostgreSQL&lt;/em&gt; 8.4 solves the problem with a shiny new feature: &lt;a target=&quot;_blank&quot; href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7079&amp;amp;entry_id=577&quot; title=&quot;http://www.postgresql.org/docs/8.4/static/sql-grant.html&quot;&gt;&lt;strong&gt;column level permissions&lt;/strong&gt;&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;font&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://andreas.scherbaum.la/blog/archives/577-PostgreSQL-8.4-Column-Permissions.html#extended&quot;&gt;Continue reading &quot;PostgreSQL 8.4: Column Permissions&quot;&lt;/a&gt;</description>
	<pubDate>Wed, 01 Jul 2009 17:00:00 +0000</pubDate>
	<author>nospam@example.com (Andreas 'ads' Scherbaum)</author>
</item>
<item>
	<title>US PostgreSQL Association: PostgreSQL 8.4 Released!</title>
	<guid>http://www.postgresql.us/node/91</guid>
	<link>http://www.postgresql.us/node/91</link>
	<description>&lt;p&gt;JD wrote:&lt;/p&gt;
&lt;p&gt;For those sleeping in &lt;a href=&quot;http://www.postgresql.org/about/news.1108&quot;&gt;PostgreSQL.org just released PostgreSQL 8.4.&lt;/a&gt; This is an exciting release with many new features including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;  Parallel Database Restore, speeding up recovery from backup up to 8 times
&lt;li&gt; Per-Column Permissions, allowing more granular control of sensitive data
&lt;li&gt; Per-database Collation Support, making PostgreSQL more useful in multi-lingual environments
&lt;li&gt; In-place Upgrades through pg_migrator (beta), enabling upgrades from 8.3 to 8.4 without extensive downtime&lt;br /&gt;
&lt;p&gt;&lt;a href=&quot;http://www.postgresql.us/node/91&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;</description>
	<pubDate>Wed, 01 Jul 2009 16:35:50 +0000</pubDate>
</item>
<item>
	<title>Robert Gravsjö: PostgreSQL 8.4 released</title>
	<guid>http://postgresql.blogg.se/2009/july/postgresql-84-released.html</guid>
	<link>http://postgresql.blogg.se/2009/july/postgresql-84-released.html</link>
	<description>Spread the word, PostgreSQL 8.4 is out!</description>
	<pubDate>Wed, 01 Jul 2009 16:30:46 +0000</pubDate>
</item>
<item>
	<title>Josh Berkus: pg_stat_statements in 8.4</title>
	<guid>http://it.toolbox.com/blogs/database-soup/pg_stat_statements-in-84-32648?rss=1</guid>
	<link>http://it.toolbox.com/blogs/database-soup/pg_stat_statements-in-84-32648?rss=1</link>
	<description>Now that PostgreSQL 8.4 is out, I thought I'd write a little about my favorite 8.4 feature.  As Mister Performance Whack-a-Mole, what makes me happy about 8.4 is the ability to whack moles faster ... which is why I'm very fond of pg_stat_statements.</description>
	<pubDate>Wed, 01 Jul 2009 12:52:42 +0000</pubDate>
</item>
<item>
	<title>Robert Lor: How to add DTrace probes to your application</title>
	<guid>http://blogs.sun.com/robertlor/entry/how_to_add_dtrace_probes</guid>
	<link>http://blogs.sun.com/robertlor/entry/how_to_add_dtrace_probes</link>
	<description>&lt;a href=&quot;http://coalface.mcslp.com/&quot;&gt;MC Brown&lt;/a&gt; and I co-presented a &lt;a href=&quot;http://developers.sun.com/events/communityone/2009/west/pdfs/S308356_D5.pdf&quot;&gt;session&lt;/a&gt; at &lt;a href=&quot;http://developers.sun.com/events/communityone/2009/west/index.jsp&quot;&gt;CommunityOne West&lt;/a&gt; on how to add probes to applications, using MySQL and PostgreSQL as case study. In the presentation, I used a very simple example to demonstrate how easy it is to add probes. If you want to try out yourself, here is the &lt;a href=&quot;http://blogs.sun.com/robertlor/resource/dtrace_probe_example.tar.gz&quot;&gt;code&lt;/a&gt;. Extract the files, run gmake (or gnumake on OS X) to build, and run the executable in one terminal and the DTrace script in another terminal to see the output from the probes. To see more complicated examples, checkout the MySQL or PostgreSQL source code.</description>
	<pubDate>Tue, 30 Jun 2009 15:22:16 +0000</pubDate>
</item>
<item>
	<title>Leo Hsu and Regina Obe: Managing disk space using table spaces</title>
	<guid>http://www.postgresonline.com/journal/index.php?/archives/123-Managing-disk-space-using-table-spaces.html</guid>
	<link>http://www.postgresonline.com/journal/index.php?/archives/123-Managing-disk-space-using-table-spaces.html</link>
	<description>&lt;p&gt;We have covered this briefly before, but its an important enough concept to cover again in more detail.&lt;/p&gt;
&lt;h5&gt;Problem: You are running out of disk space on the drive you keep PostgreSQL data on&lt;/h5&gt;
&lt;b&gt;Solution:&lt;/b&gt; &lt;br /&gt;
&lt;p&gt;Create a new tablespace on a separate drive and move existing tables to it, or create a new tablespace and use for future tables.&lt;/p&gt;

&lt;h5&gt;What is a tablespace and how to create a tablespace&lt;/h5&gt;
&lt;p&gt;A tablespace in PostgreSQL is similar to a tablespace in Oracle and a filegroup in SQL Server.  It segments a piece of physical disk space
for use by the PostgreSQL process for holding data. Below are steps to creating a new tablespace.  Tablespaces have existed since PostgreSQL 8.0. &lt;/p&gt;

&lt;p&gt;More about tablespaces in PostgreSQL is outlined in
the manual &lt;a href=&quot;http://www.postgresql.org/docs/8.3/interactive/sql-createtablespace.html&quot; target=&quot;_blank&quot;&gt;PostgreSQL 8.3 tablespaces&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While it is possible to create a table index on a different tablespace from the table, we won't be covering that.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/index.php?/archives/123-Managing-disk-space-using-table-spaces.html#extended&quot;&gt;Continue reading &quot;Managing disk space using table spaces&quot;&lt;/a&gt;</description>
	<pubDate>Tue, 30 Jun 2009 04:00:00 +0000</pubDate>
	<author>nospam@example.com (Leo Hsu and Regina Obe)</author>
</item>
<item>
	<title>Robert Lor: More on the demos from PgCon 2009</title>
	<guid>http://blogs.sun.com/robertlor/entry/more_on_the_demos_from</guid>
	<link>http://blogs.sun.com/robertlor/entry/more_on_the_demos_from</link>
	<description>&lt;p&gt;
At &lt;a href=&quot;http://www.pgcon.org/2009/&quot;&gt;PgCon 2009&lt;/a&gt; in Ottawa, I did a &lt;a href=&quot;http://wiki.postgresql.org/wiki/PgCon_2009_Lightning_talks&quot;&gt; lightning talk&lt;/a&gt; on DTrace probes in PostreSQL 8.4. I wanted to show several demos but ran out of time. If you want to try them out, use the scripts below.
&lt;/p&gt;
&lt;p&gt;
Here is the script, query_time.d, used in slide 14. This script is used to identify slow queries by printing out the query execution time.
&lt;/p&gt;

&lt;pre&gt;

#!/usr/sbin/dtrace -s
#pragma D option quiet

dtrace:::BEGIN
{
  printf(&quot;Tracing... Hit Ctrl-C to end.\n&quot;);
}

postgresql*:::query-start
{
    self-&gt;query = copyinstr(arg0);
    self-&gt;ts = timestamp;
}

postgresql*:::query-done
/self-&gt;ts/
{
    @query_time[self-&gt;query] = avg(timestamp - self-&gt;ts);
    self-&gt;query = 0;
    self-&gt;ts = 0;
}

dtrace:::END
{
     printf(&quot;%10s %s\n&quot;, &quot;TIME (ns)&quot;, &quot;QUERY&quot;);
     printf(&quot;==============================================================\n&quot;);
     printa(&quot;%@10d %s\n&quot;, @query_time);
}

&lt;/pre&gt;

&lt;p&gt;
Here is the second script, sort.d, used in slide 16. This script tells the type of sort, whether the sort was done in memory or on disk, and the time to perform the sort.
&lt;/p&gt;

&lt;pre&gt;

#!/usr/sbin/dtrace -qs

dtrace:::BEGIN
{
        sorttype[0] = &quot;TUPLE&quot;;
        sorttype[1] = &quot;INDEX&quot;;
        sorttype[2] = &quot;DATUM&quot;;

        sortmethod[0] = &quot;INTERNAL&quot;;
        sortmethod[1] = &quot;EXTERNAL&quot;;
}

postgresql*:::sort-start
{
        self-&gt;ts = timestamp;
        printf(&quot;\nBegin %s sort, workmem = %d KB \n&quot;, sorttype[arg0], arg3);
}

postgresql*:::sort-done
/self-&gt;ts &amp;amp;&amp;amp; arg0 == 0/
{
        /* Internal Sort */
        printf(&quot;%s sort ended, space used = %d KB \n&quot;, sortmethod[arg0], arg1);
        printf(&quot;Sort time = %d ms\n\n&quot;, (timestamp - self-&gt;ts) / 1000000);
}

postgresql*:::sort-done
/self-&gt;ts &amp;amp;&amp;amp; arg0 == 1 /
{        /* External Sort */
        printf(&quot;%s sort ended, space used = %d disk blocks\n&quot;, sortmethod[arg0], 
arg1);
        printf(&quot;Sort time = %d ms\n\n&quot;, (timestamp - self-&gt;ts) / 1000000);
}
&lt;/pre&gt;


&lt;p&gt;
Below is the last script, query_trace.d, used in slide 23. This script provides useful data that will allow you to dig down deeper. In this example, the buffer reads to table 16397 (this is the OID) is huge. This signals a red flag that an index may be needed for this table. To find out the table name from OID, run &quot;SELECT relname FROM pg_class WHERE relfilenode=16397&quot; in psql.
&lt;/p&gt;

&lt;pre&gt;

#!/usr/sbin/dtrace -qs

postgresql*:::query-start
{
        self-&gt;ts = timestamp;
        self-&gt;pid = pid;
}

postgresql*:::buffer-read-start
/self-&gt;pid/
{
        self-&gt;readts = timestamp;
}

postgresql*:::buffer-read-done
/self-&gt;pid &amp;amp;&amp;amp; arg7/
{
        /* Buffer cache hit */
        @read_count[arg2, arg3, arg4] = count();
        @read_hit_total[&quot;Total buffer cache hits      : &quot;] = count();
        @read_hit_time[&quot;Average read time from cache : &quot;] = avg (timestamp - self-&gt;readts);
        self-&gt;readts = 0;
}

postgresql*:::buffer-read-done
/self-&gt;pid &amp;amp;&amp;amp; !arg7/
{
        /* Buffer cache miss */
        @read_count[arg2, arg3, arg4] = count();
        @read_miss_total[&quot;Total buffer cache misses    : &quot;] = count();
        @read_miss_time[&quot;Average read time from disk  : &quot;] = avg (timestamp - self-&gt;readts);
        self-&gt;readts = 0;
}

postgresql*:::buffer-flush-start
/self-&gt;pid/
{
        self-&gt;writets = timestamp;
}

postgresql*:::buffer-flush-done
/self-&gt;pid/
{
        @write_count[arg2, arg3, arg4] = count();
        @write_time[&quot;Average write time to disk   : &quot;] = avg (timestamp - self-&gt;writets);
        self-&gt;writets = 0;
}

postgresql*:::query-done
/self-&gt;ts &amp;amp;&amp;amp; self-&gt;pid == pid/
{
        printf(&quot;\n============ Buffer Read Counts ============\n&quot;);
        printf(&quot;%10s %10s %10s %10s\n&quot;,&quot;Tablespace&quot;, &quot;Database&quot;, &quot;Table&quot;, &quot;Count&quot;);
        printa(&quot;%10d %10d %10d %@10d\n&quot;,@read_count);

        printf(&quot;\n======= Buffer Write Request Counts ========\n&quot;);
        printf(&quot;%10s %10s %10s %10s\n&quot;,&quot;Tablespace&quot;, &quot;Database&quot;, &quot;Table&quot;, &quot;Count&quot;);
        printa(&quot;%10d %10d %10d %@10d\n&quot;,@write_count);

        printf(&quot;\n========== Additional Statistics ===========\n&quot;);

        printf (&quot;Backend PID    : %d\n&quot;, pid);
        printf (&quot;SQL Statement  : %s\n&quot;, copyinstr(arg0));
        printf (&quot;Execution time : %d.%03d sec (%d ns)\n&quot;, (timestamp - self-&gt;ts) / 1000000000, ((timestamp - self-&gt;ts) / 1000000) % 1000, timestamp - self-&gt;ts);
        printa(&quot;\n%19s %@8d\n&quot;,@read_hit_total);
        printa(&quot;%19s %@8d\n&quot;,@read_miss_total);
        printa(&quot;%19s %@8d (ns)\n&quot;,@read_hit_time);
        printa(&quot;%19s %@8d (ns)\n&quot;,@read_miss_time);
        printa(&quot;%19s %@8d (ns)\n&quot;,@write_time);
        printf(&quot;\n\n&quot;);

        trunc(@read_count);
        trunc(@write_count);
        trunc(@read_hit_total);
        trunc(@read_miss_total);
        trunc(@read_hit_time);
        trunc(@read_miss_time);
        trunc(@write_time);

        self-&gt;ts = 0;
        self-&gt;pid = 0;
}

&lt;/pre&gt;

&lt;p&gt;
To see more sample scripts as well as a GUI tool, check out the &lt;a href=&quot;http://pgfoundry.org/projects/dtrace/&quot;&gt;PostgreSQL DTrace Toolkit&lt;/a&gt;.
&lt;/p&gt;</description>
	<pubDate>Mon, 29 Jun 2009 18:17:44 +0000</pubDate>
</item>
<item>
	<title>Robert Lor: PostgreSQL DTrace Toolkit</title>
	<guid>http://blogs.sun.com/robertlor/entry/postgresql_dtrace_toolkit</guid>
	<link>http://blogs.sun.com/robertlor/entry/postgresql_dtrace_toolkit</link>
	<description>As many of you know, &lt;a href=&quot;http://www.postgresql.org&quot;&gt;PostgreSQL 8.4&lt;/a&gt; has quite a few more DTrace probes. See my previous &lt;a href=&quot;http://blogs.sun.com/robertlor/entry/new_dtrace_probes_in_postgresql&quot;&gt;blog post&lt;/a&gt; for more details . To use the probes, you need to write DTrace scripts, which is quite easy to do, but to make it easier to use the probes (especially for those who are new to DTrace), I have written some scripts that you can just run from the command line. In addition, I've integrated some of those script with &lt;a href=&quot;http://opensolaris.org/os/project/dtrace-chime/&quot;&gt;Chime&lt;/a&gt; to make it even easier to visualize the data. Check out the &lt;a href=&quot;http://pgfoundry.org/frs/?group_id=1000163&amp;amp;release_id=1336&quot;&gt;toolkit&lt;/a&gt; on &lt;a href=&quot;http://pgfoundry.org&quot;&gt;PgFoundry&lt;/a&gt;.</description>
	<pubDate>Mon, 29 Jun 2009 04:19:03 +0000</pubDate>
</item>
<item>
	<title>Andrew Dunstan: Parallel pg_restore for PostgreSQL 8.4</title>
	<guid>http://people.planetpostgresql.org/andrew/index.php?/archives/27-Parallel-pg_restore-for-PostgreSQL-8.4.html</guid>
	<link>http://people.planetpostgresql.org/andrew/index.php?/archives/27-Parallel-pg_restore-for-PostgreSQL-8.4.html</link>
	<description>I try to complete at least one significant feature item per PostgreSQL release. This time the feature is making pg_restore run in parallel. This is quite important for many users, particularly some large enterprise users.&lt;br /&gt;
&lt;br /&gt;
It's important that people understand what this will do and what it won't do. pg_restores runs a number of steps. In conventional mode it simply runs them all in a single connection to the database, one after the other. In parallel mode it first runs all the quick and easy steps, essentially those that don't involve any data access, such as table and function creation, in a single connection, just like conventional mode. Then it runs the remaining steps each in its own connection. The steps are the same, and there is no parallelism within a given step. For example, a single COPY to a table is not parallelised. Rather, we run it in parallel with other data intensive steps. &lt;br /&gt;
&lt;br /&gt;
The maximum amount of parellelism is controlled by the user. This will involve some experimentation to get to the sweet spot for your setup. A good place to start is the number of physical processors you have available. The idea here is to improve the situation where the CPU is the limiting factor, and allow you to drive the restoration rate up to where IO is in fact the limiting factor. With very high end hardware we believe that you can drive the parallelism quite high. &lt;br /&gt;
&lt;br /&gt;
Like many performance features, this one might well require several releases to tweak it for optimal performance gain. The program works by keeping a pool of slots to be used for the steps that are run in parallel. One possible area for improvement is in the algorithm that selects the item to be used for a slot as it it becomes available. Currently we keep a queue of items that have no remaining unrestored dependencies. An item gets put on the queue as soon as all the items it depends on have been restored. This is likely to be a fairly good approximation of an optimal algorithm, but there might well be a way of tweaking it. Another possible area of optimsation would be to take some notice of the tablespace that each item affects, and try to balance these, so we use as many IO channels as possible.&lt;br /&gt;
&lt;br /&gt;
What is important is that we have now got the basic framework of parallel restore, so that some researchers can easily experiment with various tweaks to improve the performance.&lt;br /&gt;
&lt;br /&gt;
pg_restore is going to be with us for quiter a long time. Even if we manage to get pg_upgrade working pretty well, that will take quite a bit of time, and there is currently no guarantee that it will for for every release. So I expect pg_restore to be the most common method of upgrading for quite some time, making it run as fast as possible is thus still a significant requirement.&lt;br /&gt;
&lt;br /&gt;
I'm proud to have been able to contribute this feature to Postgres, and look forward to other people improving it further as time goes by.</description>
	<pubDate>Sun, 28 Jun 2009 12:24:52 +0000</pubDate>
	<author>nospam@example.com (Andrew Dunstan)</author>
</item>
<item>
	<title>PostgreSQL Weekly News: PostgreSQL Weekly News June 28th 2009</title>
	<guid>http://www.postgresql.org/community/weeklynews/pwn20090628</guid>
	<link>http://www.postgresql.org/community/weeklynews/pwn20090628</link>
	<description>8.4.0 will be out soon.  Meanwhile, keep testing!
&lt;a href=&quot;http://www.postgresql.org/developer/beta&quot;&gt;http://www.postgresql.org/developer/beta&lt;/a&gt;</description>
	<pubDate>Sun, 28 Jun 2009 08:00:00 +0000</pubDate>
</item>
<item>
	<title>Josh Berkus: Anyone Have a Timer for Lightning Talks?</title>
	<guid>http://it.toolbox.com/blogs/database-soup/anyone-have-a-timer-for-lightning-talks-32560?rss=1</guid>
	<link>http://it.toolbox.com/blogs/database-soup/anyone-have-a-timer-for-lightning-talks-32560?rss=1</link>
	<description>I run a lot of lightning talks, and one tool I haven't been able to find a satisfactory solution for is the timer for the talks ...</description>
	<pubDate>Sat, 27 Jun 2009 17:31:36 +0000</pubDate>
</item>
<item>
	<title>Andreas Scherbaum: Call for Papers for the PostgreSQL-Devroom at FrOSCon 2009</title>
	<guid>http://andreas.scherbaum.la/blog/archives/573-Call-for-Papers-for-the-PostgreSQL-Devroom-at-FrOSCon-2009.html</guid>
	<link>http://andreas.scherbaum.la/blog/archives/573-Call-for-Papers-for-the-PostgreSQL-Devroom-at-FrOSCon-2009.html</link>
	<description>&lt;div class=&quot;serendipity_authorpic&quot;&gt;&lt;img src=&quot;http://andreas.scherbaum.la/blog/templates/default/img/Andreas__ads__Scherbaum.jpg&quot; alt=&quot;Author&quot; title=&quot;Andreas 'ads' Scherbaum&quot; /&gt;&lt;br /&gt;&lt;span&gt;Andreas 'ads' Scherbaum&lt;/span&gt;&lt;/div&gt;&lt;p&gt;The &lt;a href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7045&amp;amp;entry_id=573&quot; title=&quot;http://www.postgresql.org/&quot; target=&quot;_blank&quot;&gt;PostgreSQL Project&lt;/a&gt; will have a dev-room at &lt;a href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7046&amp;amp;entry_id=573&quot; title=&quot;http://www.froscon.org/&quot; target=&quot;_blank&quot;&gt;FrOSCon&lt;/a&gt; on sunday, august 23, 2009. Talks wanted!&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;The theme should be PostgreSQL-related, please submit the talk(s) by using the FrOSCon Pentabarf:&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;a href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7047&amp;amp;entry_id=573&quot; title=&quot;https://pentabarf.froscon.org/submission/froscon2009/&quot; target=&quot;_blank&quot;&gt;https://pentabarf.froscon.org/submission/froscon2009/&lt;/a&gt;&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;Procedure:&lt;/p&gt; &lt;br /&gt;
&lt;ol&gt; &lt;br /&gt;
&lt;li&gt;Create account (if not yet done) and follow the confirmation link in the email&lt;br /&gt;&lt;/li&gt; &lt;br /&gt;
&lt;li&gt;Login in Pentabarf&lt;br /&gt;&lt;/li&gt; &lt;br /&gt;
&lt;li&gt;Create a new event&lt;br /&gt;&lt;/li&gt; &lt;br /&gt;
&lt;li&gt;Choose track &amp;quot;PostgreSQL&amp;quot;&lt;br /&gt;&lt;/li&gt; &lt;br /&gt;
&lt;/ol&gt; &lt;br /&gt;
&lt;p&gt;All submitters will receive a confirmation timely, if the talk is accepted. Who wants to submit a talk about databases in general - or a talk about another database - may choose the &amp;quot;&lt;a href=&quot;http://andreas.scherbaum.la/blog/exit.php?url_id=7048&amp;amp;entry_id=573&quot; title=&quot;http://opensqlcamp.org/&quot; target=&quot;_blank&quot;&gt;OpenSQL Camp&lt;/a&gt;&amp;quot; track.&lt;br /&gt;&lt;/p&gt;</description>
	<pubDate>Fri, 26 Jun 2009 17:27:59 +0000</pubDate>
	<author>nospam@example.com (Andreas 'ads' Scherbaum)</author>
</item>
<item>
	<title>Kenny Gorman: pg_reorg 1.0.4</title>
	<guid>http://www.kennygorman.com/wordpress/?p=434</guid>
	<link>http://www.kennygorman.com/wordpress/?p=434</link>
	<description>&lt;p&gt;At &lt;a href=&quot;http://www.hi5.com&quot;&gt;Hi5&lt;/a&gt;, we currently use pg_reorg1.0.3 in order to organize data in a clustered fashion. &lt;a href=&quot;http://www.kennygorman.com/wordpress/?p=334&quot;&gt; I posted previously&lt;/a&gt; about the strategy.  Our version is slightly modified, the modifications I made to the C code essentially allow pg_reorg to spin/wait for locks on the objects to be released before proceeding.&lt;/p&gt;
&lt;p&gt;The good news is the folks at &lt;a href=&quot;http://www.ntt.co.jp/RD/OFIS/active/2006pdfe/rd/index.html&quot;&gt;NTT&lt;/a&gt; have incorporated a similar change in &lt;a href=&quot;http://pgfoundry.org/projects/reorg/&quot;&gt;pg_reorg 1.0.4&lt;/a&gt;.  This is a fantastic improvement, and frankly implemented in a cleaner way than my changes.&lt;/p&gt;
&lt;p&gt;The crux of the issue is the situation where a database is being auto-vacuumed, you can&amp;#8217;t be guaranteed that pg_reorg and the vacuum will not collide.  In theory you should not need to vacuum a table which you are pg_reorg&amp;#8217;ing because that is the point of a pg_reorg, it&amp;#8217;s essentially a vacuum full w/ extra features because the table is being rebuilt from scratch.  However in an environment where auto-vacuum is being utilized to keep tables vacuumed, both will need to co-exist.&lt;/p&gt;
&lt;p&gt;The change is simple, use the NOWAIT option of lock table to fail if the lock can not be obtained.  This is wrapped in a loop until the lock is granted.  The effect is pg_reorg patiently sits and waits while your vacuums complete and then it can finish it&amp;#8217;s work.   The downside is if any of these operations run for too long, then the journal table may grow very large.  So there should be some monitoring wrapped around the code if it&amp;#8217;s intended to run in the background.  For the future we need a backoff algorithm as well as perhaps a limit to the number of spin/sleep cycles, but hey this is excellent progress.&lt;/p&gt;
&lt;p&gt;This tool is essential in my humble opinion for everyone running PostgreSQL in a high transaction/high availability environment.  By the way, pg_reorg works seamlessly with &lt;a href=&quot;http://www.slony.info/&quot;&gt;Slony-I&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The code addition does the following:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;c&quot;&gt;&lt;span&gt;for&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;;;&lt;span&gt;&amp;#41;&lt;/span&gt;                        
        &lt;span&gt;&amp;#123;&lt;/span&gt;
                command&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;BEGIN ISOLATION LEVEL READ COMMITTED&amp;quot;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
                res &lt;span&gt;=&lt;/span&gt; execute_nothrow&lt;span&gt;&amp;#40;&lt;/span&gt;table&lt;span&gt;-&lt;/span&gt;&amp;gt;lock_table, &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;; 
                &lt;span&gt;if&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;PQresultStatus&lt;span&gt;&amp;#40;&lt;/span&gt;res&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;==&lt;/span&gt; PGRES_COMMAND_OK&lt;span&gt;&amp;#41;&lt;/span&gt;
                &lt;span&gt;&amp;#123;&lt;/span&gt;
                        PQclear&lt;span&gt;&amp;#40;&lt;/span&gt;res&lt;span&gt;&amp;#41;&lt;/span&gt;;
                        &lt;span&gt;break&lt;/span&gt;;
                &lt;span&gt;&amp;#125;&lt;/span&gt;
                &lt;span&gt;else&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;sqlstate_equals&lt;span&gt;&amp;#40;&lt;/span&gt;res, SQLSTATE_LOCK_NOT_AVAILABLE&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                &lt;span&gt;&amp;#123;&lt;/span&gt;
                        &lt;span&gt;/* retry if lock conflicted */&lt;/span&gt; 
                        PQclear&lt;span&gt;&amp;#40;&lt;/span&gt;res&lt;span&gt;&amp;#41;&lt;/span&gt;;
                        command&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;ROLLBACK&amp;quot;&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
                        sleep&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
                        &lt;span&gt;continue&lt;/span&gt;;
                &lt;span&gt;&amp;#125;&lt;/span&gt;
                &lt;span&gt;else&lt;/span&gt;
                &lt;span&gt;&amp;#123;&lt;/span&gt;
                        &lt;span&gt;/* exit otherwise */&lt;/span&gt;
                        &lt;span&gt;printf&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;%s&amp;quot;&lt;/span&gt;, PQerrorMessage&lt;span&gt;&amp;#40;&lt;/span&gt;connection&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;
                        PQclear&lt;span&gt;&amp;#40;&lt;/span&gt;res&lt;span&gt;&amp;#41;&lt;/span&gt;;
                        exit&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;;        
                &lt;span&gt;&amp;#125;&lt;/span&gt;
        &lt;span&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The text below is a snip of the strace on pg_reorg while it&amp;#8217;s waiting for the lock:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;c&quot;&gt;rt_sigaction&lt;span&gt;&amp;#40;&lt;/span&gt;SIGPIPE, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_IGN&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_DFL&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;
sendto&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;&amp;quot;P&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;008&lt;span&gt;\0&lt;/span&gt;SELECT reorg.reorg_apply($&amp;quot;&lt;/span&gt;..., &lt;span&gt;529&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;529&lt;/span&gt;
rt_sigaction&lt;span&gt;&amp;#40;&lt;/span&gt;SIGPIPE, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_DFL&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_IGN&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;
poll&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#123;&lt;/span&gt;fd&lt;span&gt;=&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, events&lt;span&gt;=&lt;/span&gt;POLLIN|POLLERR, revents&lt;span&gt;=&lt;/span&gt;POLLIN&lt;span&gt;&amp;#125;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;-1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;
recvfrom&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;&amp;quot;1&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;042&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\4&lt;/span&gt;T&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;$&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\1&lt;/span&gt;reorg_apply&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&amp;quot;&lt;/span&gt;..., &lt;span&gt;16384&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;77&lt;/span&gt;
rt_sigaction&lt;span&gt;&amp;#40;&lt;/span&gt;SIGPIPE, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_IGN&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_DFL&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;
sendto&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;&amp;quot;P&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\1&lt;/span&gt;77&lt;span&gt;\0&lt;/span&gt;SELECT 1 FROM pg_locks WHE&amp;quot;&lt;/span&gt;..., &lt;span&gt;178&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;178&lt;/span&gt;
rt_sigaction&lt;span&gt;&amp;#40;&lt;/span&gt;SIGPIPE, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_DFL&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_IGN&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;
poll&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#123;&lt;/span&gt;fd&lt;span&gt;=&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, events&lt;span&gt;=&lt;/span&gt;POLLIN|POLLERR, revents&lt;span&gt;=&lt;/span&gt;POLLIN&lt;span&gt;&amp;#125;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;-1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;
recvfrom&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;, &lt;span&gt;&amp;quot;1&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;042&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\4&lt;/span&gt;T&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;!&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\1&lt;/span&gt;?column?&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&lt;span&gt;\0&lt;/span&gt;&amp;quot;&lt;/span&gt;..., &lt;span&gt;16384&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;74&lt;/span&gt;
rt_sigprocmask&lt;span&gt;&amp;#40;&lt;/span&gt;SIG_BLOCK, &lt;span&gt;&amp;#91;&lt;/span&gt;CHLD&lt;span&gt;&amp;#93;&lt;/span&gt;, &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;
rt_sigaction&lt;span&gt;&amp;#40;&lt;/span&gt;SIGCHLD, &lt;span&gt;NULL&lt;/span&gt;, &lt;span&gt;&amp;#123;&lt;/span&gt;SIG_DFL&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;
rt_sigprocmask&lt;span&gt;&amp;#40;&lt;/span&gt;SIG_SETMASK, &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, &lt;span&gt;NULL&lt;/span&gt;, &lt;span&gt;8&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;
nanosleep&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#123;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#125;&lt;/span&gt;, &lt;span&gt;&amp;#123;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#125;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Your Postgresql log file will show the following:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;sql&quot;&gt;Jun &lt;span&gt;25&lt;/span&gt; &lt;span&gt;17&lt;/span&gt;:&lt;span&gt;09&lt;/span&gt;:&lt;span&gt;33&lt;/span&gt; &lt;span&gt;&amp;lt;&lt;/span&gt;dbname&lt;span&gt;&amp;gt;&lt;/span&gt; postgres&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;7825&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;37&lt;/span&gt;&lt;span&gt;-2&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;2009&lt;/span&gt;&lt;span&gt;-06&lt;/span&gt;&lt;span&gt;-25&lt;/span&gt; &lt;span&gt;17&lt;/span&gt;:&lt;span&gt;09&lt;/span&gt;:&lt;span&gt;33&lt;/span&gt; PDTSTATEMENT:  &lt;span&gt;LOCK&lt;/span&gt; &lt;span&gt;TABLE&lt;/span&gt; &lt;span&gt;&amp;lt;&lt;/span&gt;tablename&lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;IN&lt;/span&gt; ACCESS EXCLUSIVE MODE NOWAIT
Jun &lt;span&gt;25&lt;/span&gt; &lt;span&gt;17&lt;/span&gt;:&lt;span&gt;09&lt;/span&gt;:&lt;span&gt;34&lt;/span&gt; &lt;span&gt;&amp;lt;&lt;/span&gt;dbname&lt;span&gt;&amp;gt;&lt;/span&gt; postgres&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;7825&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;: &lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;38&lt;/span&gt;&lt;span&gt;-1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;2009&lt;/span&gt;&lt;span&gt;-06&lt;/span&gt;&lt;span&gt;-25&lt;/span&gt; &lt;span&gt;17&lt;/span&gt;:&lt;span&gt;09&lt;/span&gt;:&lt;span&gt;34&lt;/span&gt; PDTERROR:  could &lt;span&gt;NOT&lt;/span&gt; obtain &lt;span&gt;LOCK&lt;/span&gt; &lt;span&gt;ON&lt;/span&gt; relation &lt;span&gt;&amp;quot;&amp;lt;tablename&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description>
	<pubDate>Fri, 26 Jun 2009 00:33:11 +0000</pubDate>
</item>
<item>
	<title>Josh Berkus: Normalization, Performance, and Virtual Private Databases</title>
	<guid>http://it.toolbox.com/blogs/database-soup/normalization-performance-and-virtual-private-databases-32525?rss=1</guid>
	<link>http://it.toolbox.com/blogs/database-soup/normalization-performance-and-virtual-private-databases-32525?rss=1</link>
	<description>Whenever I encounter a pervasive query performance problem, one of the first things I ask is, &quot;is this database really normalized?&quot;  Usually the answer is no ...</description>
	<pubDate>Thu, 25 Jun 2009 19:01:22 +0000</pubDate>
</item>
<item>
	<title>Hubert Lubaczewski: explain.depesz.com – update</title>
	<guid>http://www.depesz.com/index.php/2009/06/25/explain-depesz-com-update/</guid>
	<link>http://www.depesz.com/index.php/2009/06/25/explain-depesz-com-update/</link>
	<description>I just updated explain.depesz.com with bugfix, which changes the way Bitmap Index Scan and Bitmap Heap Scan are displayed. Apparently index and table names were not shown previously.
Thanks go to Viktor Rosenfeld for spotting and reporting the bug.</description>
	<pubDate>Thu, 25 Jun 2009 13:04:44 +0000</pubDate>
</item>
<item>
	<title>Joshua D. Drake: PostgreSQL Conference West 2009 Call for Papers</title>
	<guid>http://www.commandprompt.com/blogs/joshua_drake/2009/06/postgresql_conference_west_2009_call_for_papers/</guid>
	<link>http://www.commandprompt.com/blogs/joshua_drake/2009/06/postgresql_conference_west_2009_call_for_papers/</link>
	<description>&lt;strong&gt;PostgreSQL Conference West 2009 Call for Papers&lt;/strong&gt;

June 24th, 2009, the PostgreSQL Conference U.S. team is pleased to announce the West 2009 venue and call for papers. This year the premiere West Coast PostgreSQL Conference will be leaving its roots at Portland State University and moving north to sunny Seattle, Washington.

The event this year is being held at Seattle Central Community College from October 16th through 18th. The move to Seattle opens up a larger metropolitan area for continuing to expose databases users, developers, and administrators to the World's Most Advanced Open Source Database. Following previously successful West Coast conferences, we will be hosting a series of 3-4 hour tutorials, 90 minute mini-tutorials, and 45 minute talks.

This year we will be continuing our trend of covering the entire PostgreSQL ecosystem. We would like to see talks and tutorials on the following topics:

&lt;strong&gt;General PostgreSQL:&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;Administration
    &lt;li&gt;Performance
    &lt;li&gt;High Availability
    &lt;li&gt;Migration
    &lt;li&gt;GIS
    &lt;li&gt;Integration
    &lt;li&gt;Solutions and White Papers
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;The Stack:&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;Python/Django/Pylons/TurboGears/Custom
    &lt;li&gt;Perl5/Catalyst/Bricolage
    &lt;li&gt;Potato
    &lt;li&gt;Ruby/Rails
    &lt;li&gt;Java (PLJava would be great)/Groovy/Grails
    &lt;li&gt;Operating System optimization (Linux/FBSD/Solaris/Windows)
    &lt;li&gt;Solutions and White Papers
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;If you are using PostgreSQL as your platform, you need to be presenting at this conference!

&lt;strong&gt;&lt;div align=&quot;center&quot;&gt;&lt;a href=&quot;http://www.postgresqlconference.org/talksubmission&quot;&gt;Submit your talk&lt;/a&gt; (You must be have an account on the site)&lt;/div&gt;&lt;/strong&gt;

***
The PostgreSQL Conference U.S. series is an autonomous Educational Project used to educate all comers on the use of The World's Most Advanced Open Source Database. Proceeds from the event are donated directly to United States PostgreSQL; the 501c3
non-profit for PostgreSQL education and advocacy in the United States.</description>
	<pubDate>Wed, 24 Jun 2009 19:00:00 +0000</pubDate>
</item>
<item>
	<title>Josh Berkus: OSCON for Postgres Geeks</title>
	<guid>http://it.toolbox.com/blogs/database-soup/oscon-for-postgres-geeks-32495?rss=1</guid>
	<link>http://it.toolbox.com/blogs/database-soup/oscon-for-postgres-geeks-32495?rss=1</link>
	<description>In addition to the pgDay San Jose, there are several talks at OSCON which will be of interest to PostgreSQL community ...</description>
	<pubDate>Wed, 24 Jun 2009 18:13:32 +0000</pubDate>
</item>
<item>
	<title>Andrew Dunstan: Workation</title>
	<guid>http://people.planetpostgresql.org/andrew/index.php?/archives/26-Workation.html</guid>
	<link>http://people.planetpostgresql.org/andrew/index.php?/archives/26-Workation.html</link>
	<description>Tomorrow we pack the family and pets up and head off to Hilton Head Island for eight days. A little swimming, a little jetskiing, probably too much good dining, lots of relaxation.&lt;br /&gt;
&lt;br /&gt;
I have been prepping a laptop to take with me. Unfortunately, several clients want me to be able to do things if an emergency arises, so I need the laptop to be able to talk to their VPNs. That means I need to support whatever they use. Everybody seems to use something different. So far I am supporting Windows and Checkpoint VPN on WIndows (since that's the only place the client runs) and OpenVPN, CiscoVPN and Juniper on Linux. Many of these have the very annoying habit of locking the client machine out from any access to anything other than the VPN. That can be more than a small inconvenience. I complained about it to one client the other day and the response was &quot;Yes, we hate it too.&quot; Not enough, apparently, to change it. Overall, I have found OpenVPN to be the nicest VPN so far to use on Linux. On Windows, the native VPN works pretty simply too, and is a good fit if you're only going to be talking to Windows boxes via Remote Desktop.&lt;br /&gt;
&lt;br /&gt;
I decided yesterday to upgrade the Linux install on the laptop from Fedora 10 to Fedora 11. You would think that after all this time they would be able to handle upgrading their own packages nicely, but it didn't work any better than the last time I tried to upgrade a RedHat machine, back around the time of RedHat 9. So I backed up what little stuff I had that wasn't actually a Fedora artifact, and reinstalled. The other thing about upgrading that made it so much fun was when anaconda decided to barf when trying to mount my swap file, which it couldn't see. I had to comment it out of the fstab. Why anaconda needs to mount the swap file to upgrade, when it doesn't need any to install, AFAIK, is beyond me.&lt;br /&gt;
&lt;br /&gt;
One nice thing I noticed is that Fedora 11 has a much nicer naming scheme for volume groups and logical volumes. Good work there.&lt;br /&gt;
&lt;br /&gt;
Anyway, now I have F11, with all the VPNs working and tested. I'm hoping that customers won't be too demanding so that I can grab a few minutes to continue with making the buildfarm client support git.</description>
	<pubDate>Wed, 24 Jun 2009 12:28:23 +0000</pubDate>
	<author>nospam@example.com (Andrew Dunstan)</author>
</item>
<item>
	<title>US PostgreSQL Association: PostgreSQL at SELF</title>
	<guid>http://www.postgresql.us/node/89</guid>
	<link>http://www.postgresql.us/node/89</link>
	<description>&lt;p&gt;Michael Brewer wrote:&lt;/p&gt;
&lt;p&gt; On Saturday, June 13th, I wound up manning the PostgreSQL booth at &lt;a href=&quot;http://www.southeastlinuxfest.org/&quot;&gt;SouthEast LinuxFest&lt;/a&gt;, in Clemson, South Carolina.  This free conference drew a larger crowd than I'd expected;  organizers told me there had been some 450 registrants by the day before, and they were expecting a final total of over 500 (with walk-ups).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.postgresql.us/node/89&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Tue, 23 Jun 2009 14:22:55 +0000</pubDate>
</item>
<item>
	<title>Hubert Lubaczewski: Tips N’ Tricks – Generating readable reports with plain SQL</title>
	<guid>http://www.depesz.com/index.php/2009/06/23/tips-n%e2%80%99-tricks-generating-readable-reports-with-plain-sql/</guid>
	<link>http://www.depesz.com/index.php/2009/06/23/tips-n%e2%80%99-tricks-generating-readable-reports-with-plain-sql/</link>
	<description>Let&amp;#8217;s say you imported some data, but it contains duplicates. You will have to handle them in some way, but to make sensible choice on how to handle it, you need more information.
So, let&amp;#8217;s start. We have table:
# \d users
                [...]</description>
	<pubDate>Tue, 23 Jun 2009 11:51:43 +0000</pubDate>
</item>
<item>
	<title>Dimitri Fontaine: prefix extension reaches 1.0 (rc1)</title>
	<guid>http://blog.tapoueh.org/blog.dim.html#%20prefix%20extension%20reaches%201%2E0%20</guid>
	<link>http://blog.tapoueh.org/blog.dim.html#%20prefix%20extension%20reaches%201%2E0%20</link>
	<description>&lt;p&gt;&lt;a name=&quot;20090623-10:53&quot; id=&quot;20090623-10:53&quot;&gt;&lt;/a&gt;
&lt;a name=&quot;%20prefix%20extension%20reaches%201%2E0%20&quot; id=&quot;%20prefix%20extension%20reaches%201%2E0%20&quot;&gt;&lt;/a&gt;
At long last, after millions and millions of queries just here at work and
some more in other places, the &lt;a href=&quot;http://blog.tapoueh.org/prefix.html&quot;&gt;prefix&lt;/a&gt; project is reaching &lt;code&gt;1.0&lt;/code&gt; milestone. The
release candidate is getting uploaded into debian at the moment of this
writing, and available at the following place: &lt;a href=&quot;http://prefix.projects.postgresql.org/prefix-1.0~rc1.tar.gz&quot;&gt;prefix-1.0~rc1.tar.gz&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you have any use for it (as some &lt;em&gt;VoIP&lt;/em&gt; companies have already), please
consider testing it, in order for me to release a shiny &lt;code&gt;1.0&lt;/code&gt; next week! :)&lt;/p&gt;

&lt;p&gt;Recent changes include getting rid of those square brackets output when it's
not neccesary, fixing btree operators, adding support for more operators in
the &lt;code&gt;GiST&lt;/code&gt; support code (now supported: &lt;code&gt;@&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;@&lt;/code&gt;, &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;). Enjoy!&lt;/p&gt;</description>
	<pubDate>Tue, 23 Jun 2009 07:53:00 +0000</pubDate>
</item>
<item>
	<title>David Wheeler: pgTAP Set-Testing Update</title>
	<guid>http://feedproxy.google.com/~r/justatheory/pgsum/~3/01yKw9LbnIo/set_testing_update.html</guid>
	<link>http://feedproxy.google.com/~r/justatheory/pgsum/~3/01yKw9LbnIo/set_testing_update.html</link>
	<description>&lt;div&gt;&lt;p&gt;I've been thinking more
about &lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/comparing-relations.html&quot; title=&quot;Thoughts on Testing SQL Result Sets&quot;&gt;testing SQL result sets&lt;/a&gt; and
how to &lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/result-testing-function-names.html&quot; title=&quot;Need Help Naming Result Set Testing Functions&quot;&gt;name functions&lt;/a&gt; that
do such testing, and I've started to come to some conclusions. Some of the
constraints I'm looking at:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/set_testing_update.html&quot;&gt;Read More »&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/justatheory/pgsum/~4/01yKw9LbnIo&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 22 Jun 2009 17:34:00 +0000</pubDate>
</item>
<item>
	<title>PostgreSQL Weekly News: PostgreSQL Weekly News June 21st 2009</title>
	<guid>http://www.postgresql.org/community/weeklynews/pwn20090621</guid>
	<link>http://www.postgresql.org/community/weeklynews/pwn20090621</link>
	<description>The Call for Papers for pgday.eu is out.  Submit!
&lt;a href=&quot;http://2009.pgday.eu/&quot;&gt;http://2009.pgday.eu/&lt;/a&gt;</description>
	<pubDate>Sun, 21 Jun 2009 08:00:00 +0000</pubDate>
</item>
<item>
	<title>Robert Hodges: When SANs Go Bad</title>
	<guid>http://scale-out-blog.blogspot.com/2009/06/when-sans-go-bad.html</guid>
	<link>http://scale-out-blog.blogspot.com/2009/06/when-sans-go-bad.html</link>
	<description>They sometimes go bad in completely unpredictable ways.  Here's a problem I have now seen twice in production situations.  A host boots up nicely and mounts file systems from the SAN.  At some point a SAN switch (e.g., through a Fibrechannel controller) fails in such a way that the SAN goes away but the file system still appears visible to applications.&lt;br /&gt;&lt;br /&gt;This kind of problem is an example of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Byzantine_Fault_Tolerance&quot;&gt;Byzantine fault&lt;/a&gt; where a system does not fail cleanly but instead starts to behave in a completely arbitrary manner.  It seems that you can get into a state where the in-memory representation of the file system inodes is intact but the underlying storage is non-responsive.  The non-responsive file system in turn can make operating system processes go a little crazy.  They continue to operate but show bizarre failures or hang.  The result is problems that may not be diagnosed or even detected for hours.&lt;br /&gt;&lt;br /&gt;What to do about this type of failure?   Here are some ideas.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;Be careful what you put on the SAN&lt;/span&gt;.  Log files and other local data should not go onto the SAN.  Use local files with syslog instead.  Think about it:  your application is sick and trying to write a log message to tell you about it on a non-responsive file system.  In fact, if you have a robust scale-out architecture, don't use a SAN at all.   Use database replication and/or DRBD instead to protect your data.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Test the SAN configuration carefully, especially failover scenarios&lt;/span&gt;.  What happens when the host fails from access one path to another?  What happens when another host picks up the LUN from a &quot;failed&quot; host?  Do you have fencing properly enabled?&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Actively look for SAN failures&lt;/span&gt;.  Write test files to each mounted file system and read them back as part of your regular monitoring.   That way you know that the file system is fully &quot;live.&quot;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;The last idea gets at a core issue with SAN failures--they are rare, so it's not the first thing people  think of when there is a problem.  The first time this happened on one of my systems it was around 4am in the morning.   It took a really long time to figure out what was going on.  We didn't exactly feel like geniuses when we finally checked the file system.&lt;br /&gt;&lt;br /&gt;SANs are great technology, but there is an increasingly large &quot;literature&quot; of SAN failures on the net, such as &lt;a href=&quot;http://arjen-lentz.livejournal.com/132978.html&quot;&gt;this overview from Arjen Lentz&lt;/a&gt; and &lt;a href=&quot;http://communities.vmware.com/thread/195806&quot;&gt;this example of a typical failure.&lt;/a&gt;   You need to design mission-critical systems with SAN failures in mind.  Otherwise you may want to consider avoiding SAN use entirely.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/768233104244702633-5151745197465987146?l=scale-out-blog.blogspot.com&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Sat, 20 Jun 2009 11:27:34 +0000</pubDate>
	<author>noreply@blogger.com (Robert Hodges)</author>
</item>
<item>
	<title>PDXPUG: OSBridge Pg BOF!</title>
	<guid>http://pugs.postgresql.org/node/553</guid>
	<link>http://pugs.postgresql.org/node/553</link>
	<description>&lt;p&gt;Reporting LIVE from OSBridge...we had the PostgreSQL BOF at the same time as our monthly PDXPUG meeting.  6 regulars, a new person, and a couple of out-of-towners were in attendance.  Josh B gave us a quick overview of 8.4.  293 (or 297!) new features.  In addition to the big stuff (like windowing functions) there are a ton of little administrative tweaks.  I am particularly excited about the new functionality of \df - displays only user-defined fuctions.&lt;/p&gt;
&lt;p&gt;Announcements:&lt;br /&gt;
PgDay is Saturday Sept 19 in Athens, GA!  Make your plans now.&lt;/p&gt;
&lt;p&gt;Michael Brewer highly recommends the use of a tuba as a booth prop.  Ask him to tell you the story.&lt;/p&gt;
&lt;p&gt;Selena &amp;amp; I are working on &lt;a href=&quot;http://www.baconandtech.com/2009/06/06/book-review-part-i-refactoring-sql-applications-with-bonus-queries/trackback/&quot;&gt;PostgreSQL equivalents&lt;/a&gt; for the queries in Stephan Faroult's _Refactoring SQL Applications_.&lt;/p&gt;
&lt;p&gt;I was disappointed to learn that TrustTheVote is running on MySQL.  Granted, it's an improvement over current voting software, but maybe we want to talk to them about running on a different, say, more elephantine database?&lt;/p&gt;
&lt;p&gt;Future plans:&lt;br /&gt;
Josh told us about the patch review process.  You don't have to be able to read C!  If you can read the spec, apply the patch, verify that it works, proof the docs - you can be a reviewer!  All you need to do is write a report.  Webb suggested PDXPUG have a patch review party - sounds like a great idea to me!&lt;/p&gt;</description>
	<pubDate>Fri, 19 Jun 2009 04:31:07 +0000</pubDate>
</item>
<item>
	<title>Leo Hsu and Regina Obe: Restore of functional indexes gotcha</title>
	<guid>http://www.postgresonline.com/journal/index.php?/archives/121-Restore-of-functional-indexes-gotcha.html</guid>
	<link>http://www.postgresonline.com/journal/index.php?/archives/121-Restore-of-functional-indexes-gotcha.html</link>
	<description>&lt;p&gt;
	This has been bugging me for a long time and I finally complained about it and Tom Lane kindly gave a reason for the problem and that its by design and not a bug.
&lt;/p&gt;
&lt;p&gt;So I thought I would post the situation here without getting into too many embarassing specifics in case others have suffered from a similar fate and can learn from this.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The situation: &lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
	&lt;li&gt;You create a function lets call it &lt;b&gt;myniftyfunc()&lt;/b&gt; in the public schema. &lt;/li&gt;
	&lt;li&gt;Then you create another function that depends on myniftyfunc(), lets call it &lt;b&gt;mysuperniftyfunc()&lt;/b&gt; also in public schema.&lt;/li&gt;
	&lt;li&gt;Then because your function is such a super nifty function, you decide to create a functional index with that super function on your table that sits in mysuperdata schema -  &lt;b&gt;mysuperdata.mysupertable&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;Your super nifty function is doing its thing; your table is happy; the planner is spitting out your queries lightning fast using the super nifty index on your super table;
The world is good.&lt;/p&gt;
&lt;p&gt;One day you decide to restore your nifty database backup and to your chagrin, your nifty index is not there.  The planner is no longer happily spitting out your queries lighting fast and everything has come to a painful crawl.
Your super nifty index is gone.  What happened to super nifty functional index?&lt;/p&gt;

&lt;p&gt;I have to admit that I'm the type of person that assumes the public schema is always there and always in search_path and that my assumption is a flawed one.  After all the public schema is there by default on new databases for convenience,
but one can change it not to be in the search_path and in fact &lt;b&gt;pg_dump&lt;/b&gt; does just that.  So if everything you have is kept in public schema -- you don't run into this particular misfortune.  If however you have your functions in
public and your tables in different schemas, during restore -- the search path is changed to the schema being restored and your super functional indexes based on super functions that depend on other super functions fail because public is no longer in the search_path. &lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/index.php?/archives/121-Restore-of-functional-indexes-gotcha.html#extended&quot;&gt;Continue reading &quot;Restore of functional indexes gotcha&quot;&lt;/a&gt;</description>
	<pubDate>Fri, 19 Jun 2009 03:04:00 +0000</pubDate>
	<author>nospam@example.com (Leo Hsu and Regina Obe)</author>
</item>
<item>
	<title>Andrew Dunstan: Misuse of SQL</title>
	<guid>http://people.planetpostgresql.org/andrew/index.php?/archives/25-Misuse-of-SQL.html</guid>
	<link>http://people.planetpostgresql.org/andrew/index.php?/archives/25-Misuse-of-SQL.html</link>
	<description>Today I was reminded of something I saw about 15 years ago, when working as a systems adminstrator. One of the application developers had a large amount of data that needed to be sorted. Knowing SQL, he wrote a program in C with embedded SQL which created a table, read in the data, and then selected it with an ORDER BY clause. Problem solved.&lt;br /&gt;
&lt;br /&gt;
Talk about a sledgehammer to crack a nut. Switching metaphors, I guess it's a case of everything looking like a nail if all you have is a hammer.&lt;br /&gt;
&lt;br /&gt;
Note that 10 lines of C code would have sorted the data in a fraction of the time. Or a simple call to the unix sort utility. Even if the data were too big to fit in memory, something much lighter like using a Berkeley DB btree or hash would have hardly been much more trouble.&lt;br /&gt;
&lt;br /&gt;
Today I saw something similar. Someone created an in-memory SQLite table, and set up an index on it, just for fast random access to it. And this was in PHP which has associative arrays which presumably offer fast keyed access (by hashing the keys I guess - I know nothing of the innards of PHP.)&lt;br /&gt;
&lt;br /&gt;
After rolling on the floor laughing for a while, I ripped the guts out of this thing and just emulated it using an array of arrays. Guess what? Performance was fine and the program no longer relies on SQLite, the non-PDO version of which isn't available on the version of PHP installed on the machine in question.&lt;br /&gt;
&lt;br /&gt;
SQL is not a general purpose tool. It's a tool for manipulating data with quite specialised needs, and using it for something else is just silly.&lt;br /&gt;
&lt;br /&gt;</description>
	<pubDate>Thu, 18 Jun 2009 22:12:41 +0000</pubDate>
	<author>nospam@example.com (Andrew Dunstan)</author>
</item>
<item>
	<title>Gabriele Bartolini: Free PostgreSQL support for the students of the University of L'Aquila</title>
	<guid>http://www.gabrielebartolini.it/blog/2009/06/postgresql-support-at-university-aquila.html</guid>
	<link>http://www.gabrielebartolini.it/blog/2009/06/postgresql-support-at-university-aquila.html</link>
	<description>We all know about the terrible events following the earthquake that shook the city of L'Aquila and the entire Abruzzo region last April.&lt;br /&gt;In assisting the university to reinstate its teaching program, the company I work for (&lt;a href=&quot;http://www.2ndquadrant.it/&quot;&gt;2ndQuadrant Italia&lt;/a&gt;) will offer students a free and preferential consulting service on PostgreSQL.
         Back in February and March, we had had several e-mail exchanges and a few Skype sessions with Professor Paolino Di Felice from the &quot;&lt;a href=&quot;http://www.univaq.it/&quot;&gt;Università degli
Studi dell'Aquila&lt;/a&gt;&quot;.&lt;br /&gt;I was supposed to visit their University in May, together with my colleague Gianni Ciolli. The aim of the visit was to personally get to know Prof. Di Felice and the students of his database systems class, and to introduce them to PostgreSQL.&lt;br /&gt;Unfortunately, we all know what happened afterwards.&lt;br /&gt;Our initiative aims to help students gain practical skills and knowledge in installation
procedures, configuration and the usage of PostgreSQL.&lt;br /&gt;This embraces also Italian PostgreSQL Users Group's objective for the
introduction of PostgreSQL in the Italian schools and universities.&lt;br /&gt;The joint
agreement will take effect from 1 October 2009 and has a duration of 15
months. More information are in the &lt;a href=&quot;http://blog.2ndquadrant.it/it/2009/06/2ndquadrant-e-universita-aquila.html&quot;&gt;Italian press announcement&lt;/a&gt;.&lt;br /&gt; Finally, I am also happy to restart my PlanetPostgreSQL.org activity with such great news for the whole PostgreSQL community!&lt;br /&gt;&lt;br /&gt;</description>
	<pubDate>Thu, 18 Jun 2009 08:12:17 +0000</pubDate>
</item>
<item>
	<title>Robert Hodges: Lots of New Tungsten Builds--Get 'Em While They're Hot</title>
	<guid>http://scale-out-blog.blogspot.com/2009/06/lots-of-new-tungsten-builds-get-em.html</guid>
	<link>http://scale-out-blog.blogspot.com/2009/06/lots-of-new-tungsten-builds-get-em.html</link>
	<description>There is a raft of new &lt;a href=&quot;https://sourceforge.net/project/showfiles.php?group_id=256125&quot;&gt;Tungsten open source builds&lt;/a&gt; available for your replication and clustering pleasure.  Over the last couple of days we uploaded new binary builds for &lt;a href=&quot;http://www.continuent.com/community/tungsten-replicator&quot;&gt;Tungsten Replicator&lt;/a&gt;, &lt;a href=&quot;http://www.continuent.com/community/tungsten-connector&quot;&gt;Tungsten Connector&lt;/a&gt;, &lt;a href=&quot;http://www.continuent.com/community/tungsten-monitor&quot;&gt;Tungsten Monitor&lt;/a&gt;, and &lt;a href=&quot;http://www.continuent.com/community/tungsten-sql-router&quot;&gt;Tungsten SQL Router&lt;/a&gt;.   These contain the features described in &lt;a href=&quot;http://scale-out-blog.blogspot.com/2009/06/tungsten-development-news-lots-of-new.html&quot;&gt;my previous blog article&lt;/a&gt;, including even more bug fixes (&lt;a href=&quot;http://forge.continuent.org/jira/secure/ReleaseNote.jspa?projectId=10110&amp;amp;styleName=Html&amp;amp;version=10295&quot;&gt;36 on Tungsten Replicator alone&lt;/a&gt;) than I had expected as we had a debugging fest over the last few days that knocked off a bunch of issues.  You can pick up the builds on the &lt;a href=&quot;https://sourceforge.net/project/showfiles.php?group_id=256125&quot;&gt;Tungsten download page&lt;/a&gt;.   Docs are posted on the &lt;a href=&quot;http://sourceforge.net/apps/mediawiki/tungsten/index.php?title=Main_Page&quot;&gt;Tungsten wiki&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you have questions, see problems with the builds, or just want to tell us how great they are, please post on the &lt;a href=&quot;http://www.continuent.com/community/forum&quot;&gt;community forums&lt;/a&gt; or on the &lt;a href=&quot;https://sourceforge.net/mailarchive/forum.php?forum_name=tungsten-discuss&quot;&gt;tungsten-discuss mailing list&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Our next open source release will be the Tungsten Manager, which is long overdue to join the family of regular builds.  We are doing some polishing work on the state machine processing and group communications, after which the Manager will go out along with documentation on how to use it.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/768233104244702633-5007524964347009380?l=scale-out-blog.blogspot.com&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Thu, 18 Jun 2009 07:01:38 +0000</pubDate>
	<author>noreply@blogger.com (Robert Hodges)</author>
</item>
<item>
	<title>Hubert Lubaczewski: explain.depesz.com – update</title>
	<guid>http://www.depesz.com/index.php/2009/06/17/explaindepeszcom-update-4/</guid>
	<link>http://www.depesz.com/index.php/2009/06/17/explaindepeszcom-update-4/</link>
	<description>I just updated explain.depesz.com with 2 new interface features:

When you put mouse cursor over node, it will mark direct child nodes with 
When you click on node, all child nodes (even indirect) will be hidden, and the node you clicked on will be marked with 

Both features are directed towards people who analyze longer plans [...]</description>
	<pubDate>Wed, 17 Jun 2009 15:48:18 +0000</pubDate>
</item>
<item>
	<title>Robert Treat: Got Team?</title>
	<guid>http://www.xzilla.net/blog/2009/Jun/Got-Team.html</guid>
	<link>http://www.xzilla.net/blog/2009/Jun/Got-Team.html</link>
	<description>This blog post is just a test posting for some new functionality just added to &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=355&amp;amp;entry_id=471&quot; title=&quot;http://planet.postgresql.org/&quot;&gt;Planet PostgreSQL&lt;/a&gt;. Since it revolves around teams, I thought I'd do some self promotion, or rather, team building promotion. You see, we're still &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=353&amp;amp;entry_id=471&quot; title=&quot;http://omniti.com/is/hiring/database-administrator&quot;&gt;looking for DBA's&lt;/a&gt; here at OmniTI. Our database management practice continues to grow, and we need smart people to come work on some of the biggest systems and highest transaction loads  you can find on Postgres. We'll also make you work with things like Oracle, MySQL, Sqlite, and who knows what else, just enough to make you question your assumptions. It's not for the faint of heart, but it's certainly interesting. Sound good? See &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=353&amp;amp;entry_id=471&quot; title=&quot;http://omniti.com/is/hiring/database-administrator&quot;&gt;the website for details&lt;/a&gt;, and who knows, maybe you'll end up on Planet Postgres as part of &quot;Team OmniTI&quot;! &lt;img src=&quot;http://www.xzilla.net/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; class=&quot;emoticon&quot; /&gt;</description>
	<pubDate>Tue, 16 Jun 2009 19:03:00 +0000</pubDate>
	<author>nospam@example.com (Robert Treat)</author>
</item>
<item>
	<title>Magnus Hagander: Planet updates</title>
	<guid>http://blog.hagander.net/archives/148-Planet-updates.html</guid>
	<link>http://blog.hagander.net/archives/148-Planet-updates.html</link>
	<description>&lt;p&gt;I've just deployed a new version of the code that runs &lt;a href=&quot;http://blog.hagander.net/exit.php?url_id=162&amp;amp;entry_id=148&quot; title=&quot;http://planet.postgresql.org&quot;&gt;http://planet.postgresql.org&lt;/a&gt;. Most of this code was written by &lt;a href=&quot;http://blog.hagander.net/exit.php?url_id=163&amp;amp;entry_id=148&quot; title=&quot;http://www.chesnok.com/daily&quot;&gt;Selena&lt;/a&gt; and me during the &lt;a href=&quot;http://blog.hagander.net/exit.php?url_id=164&amp;amp;entry_id=148&quot; title=&quot;https://blog.hagander.net/archives/143-Getting-started-at-pgcon.html&quot;&gt;initial days&lt;/a&gt; at PGCon. It just needed some minor polishing, which I didn't get around to until now. So, the new things are:&lt;/p&gt;

&lt;dl&gt;
    &lt;dt&gt;Support for &lt;i&gt;Team blogs&lt;/i&gt;&lt;/dt&gt;
        &lt;dd&gt;This is just a grouping of existing blogs, not actually something new we parse. The idea is to give some exposure to a team someone works for - for example, a specific PostgreSQL support company.&lt;/dd&gt;
    &lt;dt&gt;Top posters list&lt;/dt&gt;
        &lt;dd&gt;The list of all subscriptions has been replaced with a list of top posters. The list was becoming a bit too large to manage, and didn't really fill a purpose. And it was hard to integrate nicely with the &lt;i&gt;Team blogs&lt;/i&gt; feature.&lt;/dd&gt;
    &lt;dt&gt;There has also been a bunch of internal changes&lt;/dt&gt;
        &lt;dd&gt;Details available in the git repo on &lt;a href=&quot;http://blog.hagander.net/exit.php?url_id=165&amp;amp;entry_id=148&quot; title=&quot;http://git.postgresql.org&quot;&gt;http://git.postgresql.org&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;If you want to make use of the &lt;i&gt;Team blogs&lt;/i&gt; feature, this has unfortunately not been implemented in the admin interface. We (well, me, really) were just a bit too lazy for that. So if you want to make use of it, please just send an email to planet@postgresql.org letting us know what name you want for the team, and which blogs to add to it (these blogs should already be subscribed to planet).&lt;/p&gt;</description>
	<pubDate>Tue, 16 Jun 2009 18:43:00 +0000</pubDate>
	<author>nospam@example.com (Magnus Hagander)</author>
</item>
<item>
	<title>Bruce Momjian: Pg_Migrator Release Candidate 1</title>
	<guid>http://momjian.us/main/blogs/pgblog.html#June_16_2009</guid>
	<link>http://momjian.us/main/blogs/pgblog.html#June_16_2009</link>
	<description>&lt;p&gt;I have released pg_migrator &lt;a href=&quot;http://pgfoundry.org/frs/?group_id=1000235&quot;&gt;release candidate 1&lt;/a&gt; today.  I was planning on doing the final
release this week, but the backend API that pg_migrator uses was improved in Postgres 8.4 RC1 so pg_migrator now requires an 8.4 RC1 or
later server and no longer works for Postgres 8.4 beta versions.  Also, Tom Lane pointed out that pg_migrator shouldn't go final until
PostgreSQL goes final, so I will continue in RC status until PostgreSQL 8.4 final is released.
&lt;/p&gt;</description>
	<pubDate>Tue, 16 Jun 2009 16:00:00 +0000</pubDate>
</item>
<item>
	<title>Bruce Momjian: Professor Momjian</title>
	<guid>http://momjian.us/main/blogs/pgblog.html#June_15_2009</guid>
	<link>http://momjian.us/main/blogs/pgblog.html#June_15_2009</link>
	<description>&lt;p&gt;You might remember the &lt;a href=&quot;http://www.postgresqlconference.org/2009/east/&quot;&gt;PostgreSQL East&lt;/a&gt; conference that took place this past April at
&lt;a href=&quot;http://www.drexel.edu/&quot;&gt;Drexel University&lt;/a&gt; in Philadelphia.  As part of the event, I and other conference leaders had dinner with the
Drexel Computer Science Department Head, &lt;a href=&quot;http://www.cs.drexel.edu/~jjohnson/&quot;&gt;Jeremy Johnson&lt;/a&gt;.  One item we discussed was our
frustration at the limited academic adoption of Postgres, even though Postgres is better for education than many other databases used in academia.
Jeremy seemed to understand our plight, and I gave him my business card in case I could help Drexel, perhaps by doing a guest lecture
about Postgres.
&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://momjian.us/main/blogs/pgblog.html#June_15_2009&quot;&gt;Read More &amp;raquo;&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 15 Jun 2009 16:00:00 +0000</pubDate>
</item>
<item>
	<title>PostgreSQL Weekly News: PostgreSQL Weekly News June 14th 2009</title>
	<guid>http://www.postgresql.org/community/weeklynews/pwn20090614</guid>
	<link>http://www.postgresql.org/community/weeklynews/pwn20090614</link>
	<description>PostgreSQL 8.4 RC1 will be out soon.  Test!
&lt;a href=&quot;http://www.postgresql.org/developer/beta&quot;&gt;http://www.postgresql.org/developer/beta&lt;/a&gt;</description>
	<pubDate>Sun, 14 Jun 2009 08:00:00 +0000</pubDate>
</item>
<item>
	<title>Stefan Kaltenbrunner: Benchmarking 8.4 - Chapter 1/Read-Only workloads</title>
	<guid>http://www.kaltenbrunner.cc/blog/index.php?/archives/26-Benchmarking-8.4-Chapter-1Read-Only-workloads.html</guid>
	<link>http://www.kaltenbrunner.cc/blog/index.php?/archives/26-Benchmarking-8.4-Chapter-1Read-Only-workloads.html</link>
	<description>&lt;p&gt;Computing platforms are constantly changing, evolving and improving. This holds true for both the hardware and the software running on that hardware.&lt;br /&gt;
With PostgreSQL 8.4 just around the &lt;a href=&quot;http://archives.postgresql.org/pgsql-hackers/2009-06/msg00469.php&quot;&gt;corner&lt;/a&gt; and a 2U Nehalem based IBM x3650M2 at my hands I thought I would do some benchmarking and see how well PostgreSQL does on that kind of hardware under a range of different workloads. This is planned as a series of posts starting with read-only benchmarking, followed up by bulk load testing and maybe some OLTP benchmarks as well.&lt;/p&gt;

 &lt;br /&gt;&lt;a href=&quot;http://www.kaltenbrunner.cc/blog/index.php?/archives/26-Benchmarking-8.4-Chapter-1Read-Only-workloads.html#extended&quot;&gt;Continue reading &quot;Benchmarking 8.4 - Chapter 1/Read-Only workloads&quot;&lt;/a&gt;</description>
	<pubDate>Fri, 12 Jun 2009 20:21:00 +0000</pubDate>
	<author>nospam@example.com (Stefan Kaltenbrunner)</author>
</item>
<item>
	<title>Joshua D. Drake: The shortest path between two points</title>
	<guid>http://www.commandprompt.com/blogs/joshua_drake/2009/06/the_shortest_path_between_two_points/</guid>
	<link>http://www.commandprompt.com/blogs/joshua_drake/2009/06/the_shortest_path_between_two_points/</link>
	<description>Recently I was doing some benchmarking on one of our machines. The benchmarking wasn't going so well due to &lt;a href=&quot;http://www.commandprompt.com/blogs/joshua_drake/2009/05/hardware_problem_solved_when_you_really_need_some_cache/&quot;&gt;bad batteries on the RAID controller&lt;/a&gt;. I had instructed one of our System Administrators to take care of the problem.

Long story short, the Administrator went down a very long trail to an obvious solution. The trail was well mapped, thought out and precise. It however missed some important points. When I caught on to the long trail she was taking I asked, &quot;What is the shortest path between two points?&quot;. She replied, &quot;On a plane or sphere?&quot;. That is when I knew we were in trouble.

Now most people would have just said, &quot;Huh?&quot;. Luckily I have been blessed with at least a modicum of technical/mathematical knowledge and a general experience with Geeks for 18 years. Let's review. 

&lt;strong&gt;The System Administrators trail was:&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Visit Colo to check cards physically after receiving BIOS message
&lt;li&gt;Record all information about cards including BIOS versions
&lt;li&gt;Research possible cause of batteries not charging, find that some versions of the BIOS can do that. Thus causing yet another trip to the colo for installation.
&lt;li&gt;Go back to colo to update BIOS revisions to see if that resolves the problem&lt;ul&gt;
      &lt;li&gt;If that doesn't solve the problem, research new batteries for order
   &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;My trail:&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;System reports batteries are bad
           &lt;li&gt;Known fact: Hardware was bought used
           &lt;li&gt;Buy new batteries
           &lt;li&gt;Upgrade BIOS during new battery installation
       &lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;What is the difference? I run into this a lot with technical people. They become hyper focused and they are not able to abstract their problem solving skills to include the entirety of the problem. Now you say, &quot;What the problem is the batteries don't work, fix them.&quot; It isn't that simple. 

Using the System Administrators path, the solution to the problem cost at least 1500.00-2000.00. Using my path, the cost is 550.00. My path is a single trip to the collocation facility with cards drop shipped, an hour to replace and upgrade BIOS.  Same resolution, ~ 37% of the cost.

&lt;strong&gt;But... But... what if that doesn't fix the problem?&lt;/strong&gt;

Then you know you have bad cards and it will still cost less to replace them that to perform multiple trips to the colo.

Again it isn't that the System Administrators path was incorrect. In fact I would bet a lot of businesses would think it was the absolutely correct direction to take. I would rather just write off the cards and replace them. We can make far more money from the System Administrator if they are not focusing on long and winding roads to the same destination that can be reached by not taking a left at the fork.</description>
	<pubDate>Fri, 12 Jun 2009 17:52:12 +0000</pubDate>
</item>
<item>
	<title>Robert Treat: The Asynchronous Services Analogy</title>
	<guid>http://www.xzilla.net/blog/2009/Jun/The-Asynchronous-Services-Analogy.html</guid>
	<link>http://www.xzilla.net/blog/2009/Jun/The-Asynchronous-Services-Analogy.html</link>
	<description>Today I had a chance to sit through a sneak preview of &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=346&amp;amp;entry_id=470&quot; title=&quot;http://lethargy.org/~jesus/&quot;&gt;Theo Schlossnagle&lt;/a&gt;'s new talk &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=347&amp;amp;entry_id=470&quot; title=&quot;http://en.oreilly.com/velocity2009/public/schedule/detail/8859&quot;&gt;Scalable Internet Architectures&lt;/a&gt;, to be delivered next week at &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=348&amp;amp;entry_id=470&quot; title=&quot;http://en.oreilly.com/velocity2009/&quot;&gt;Velocity 2009&lt;/a&gt; (Dev sessions are an underrated side benefit of &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=349&amp;amp;entry_id=470&quot; title=&quot;http://omniti.com/is/hiring/database-administrator&quot;&gt;working at OmniTI&lt;/a&gt;). As always Theo packs a lot of good information into his talks; I could probably do blog entries on half a dozen ideas I jotted down; but I wanted to highlight something that he mentioned with regards to scaling websites via asynchronous services. &lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.xzilla.net/blog/2009/Jun/The-Asynchronous-Services-Analogy.html#extended&quot;&gt;Continue reading &quot;The Asynchronous Services Analogy&quot;&lt;/a&gt;</description>
	<pubDate>Fri, 12 Jun 2009 03:52:02 +0000</pubDate>
	<author>nospam@example.com (Robert Treat)</author>
</item>
<item>
	<title>Josh Berkus: Tech Talk Tip #3: Talk Abstract</title>
	<guid>http://it.toolbox.com/blogs/database-soup/tech-talk-tip-3-talk-abstract-32200?rss=1</guid>
	<link>http://it.toolbox.com/blogs/database-soup/tech-talk-tip-3-talk-abstract-32200?rss=1</link>
	<description>Ok, so you've investigated the conference and you have a title for your talk.  Now they want a talk abstract and description, and maybe a bio.  What do you put there?</description>
	<pubDate>Thu, 11 Jun 2009 00:22:30 +0000</pubDate>
</item>
<item>
	<title>Robert Hodges: Tungsten Development News - Lots of New Features!</title>
	<guid>http://scale-out-blog.blogspot.com/2009/06/tungsten-development-news-lots-of-new.html</guid>
	<link>http://scale-out-blog.blogspot.com/2009/06/tungsten-development-news-lots-of-new.html</link>
	<description>Articles on this blog have been pretty scanty of late for a simple reason--we have been 100% heads-down in &lt;a href=&quot;http://www.continuent.com/community&quot;&gt;Tungsten&lt;/a&gt; code since the &lt;a href=&quot;http://www.mysqlconf.com/mysql2009&quot;&gt;recent MySQL Conference&lt;/a&gt;.   The result has been a number of excellent improvements that are already in Subversion and will appear as open source builds over the next couple of weeks.&lt;br /&gt;&lt;br /&gt;Tungsten has a simple goal:  create highly available, performant database clusters using unaltered commodity databases that are simple to manage and look as close to a single database as possible for applications.  Over the last two months we completed the integration of individual Tungsten components necessary to make this happen. &lt;br /&gt;&lt;br /&gt;Full integration is a big step forward and finally gets us to the ease-of-use we were seeking.  Imagine you want to add a slave database to the cluster.  There's no management procedure any more--you just turn it on.  Managers in the cluster automatically detect the new slave and add it as a data source.  That's the way we want every component to work from top to bottom--either on or off, end of story.  It was really nice to see it start to work a few weeks ago. &lt;br /&gt;&lt;br /&gt;We are now ready to start pushing builds out to the &lt;a href=&quot;https://sourceforge.net/projects/tungsten&quot;&gt;Tungsten SourceForge.net project&lt;/a&gt;.  Here is a selection of the features: &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.continuent.com/community/tungsten-replicator&quot;&gt;Tungsten Replicator&lt;/a&gt; -- API support for seamless failover, certification on Solaris, better Windows support, testing against &lt;a href=&quot;http://askmonty.org/wiki/index.php/MariaDB&quot;&gt;MariaDB&lt;/a&gt;, and many other improvements like flush events for seamless failover.  There are already 26 fixes in &lt;a href=&quot;http://forge.continuent.org/jira/browse/TREP?report=com.atlassian.jira.plugin.system.project:roadmap-panel&quot;&gt;JIRA&lt;/a&gt; and I expect more before we post the build.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.continuent.com/community/tungsten-sql-router&quot;&gt;Tungsten SQL Router&lt;/a&gt; -- Pluggable load balancing with session consistency support.  Session consistency means users see their own writes but can read changes by other users from a slave.  It works using a single database connection, which is an important step toward eliminating application changes in order to scale on master/slave clusters.  &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.continuent.com/community/tungsten-manager&quot;&gt;Tungsten Manager&lt;/a&gt; -- Directory-based management model that allows you to view and manage both JMX-enabled services as well as regular operating system processes that follow the familiar LSB pattern of 'service name start/stop/restart'.   The managers use group communications and can broadcast commands across multiple hosts, handle failures, and automatically detect new services as they come online. &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.continuent.com/community/tungsten-monitor&quot;&gt;Tungsten Monitor&lt;/a&gt; -- Improved monitoring of replicator status including slave latency, which is necessary to guide SQL Router load balancing features like session consistency.&lt;br /&gt;&lt;br /&gt;There's a lot going on with Tungsten right now, in fact far too many things to mention even in a longish post like this one.  One of my current code projects is to implement &lt;a href=&quot;http://forge.continuent.org/jira/browse/TREP-278&quot;&gt;built-in backup and restore&lt;/a&gt; for Tungsten Replicator.  I am planning on supporting slave auto-provisioning:  a new slave comes up, restores the latest backup, and starts replicating.   All you have to do is turn the slave on.   (More of that on/off stuff--it's kind of an obsession for us at this point.)&lt;br /&gt;&lt;br /&gt;Integrating backup/restore is the final big feature for Tungsten Replicator 1.0--after this we plan to turn attention to parallel replication and are already discussing how this might work with several potential customers.  Feel free to contact me through this blog or better yet post on the &lt;a href=&quot;http://www.continuent.com/community/forum?func=view&amp;amp;id=246&amp;amp;catid=2&quot;&gt;community forums parallel replication topic&lt;/a&gt; to join the conversation. &lt;br /&gt;&lt;br /&gt;One final bit of news, we are starting to work seriously on Tungsten PostgreSQL integration thanks to a &lt;a href=&quot;http://www.continuent.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=926&amp;amp;Itemid=27&quot;&gt;new partnership between Continuent and 2nd Quadrant&lt;/a&gt;.  This work is commercially focused for now but will lead to additional open source features in the not too distant future.  Keep watching this space... :)&lt;br /&gt;&lt;br /&gt;p.s., We also had a nice refit on the &lt;a href=&quot;http://www.continuent.com/community&quot;&gt;community website&lt;/a&gt;.  Check it out.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/768233104244702633-7495889622209955434?l=scale-out-blog.blogspot.com&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Wed, 10 Jun 2009 13:50:50 +0000</pubDate>
	<author>noreply@blogger.com (Robert Hodges)</author>
</item>
<item>
	<title>Leo Hsu and Regina Obe: Planner Statistics</title>
	<guid>http://www.postgresonline.com/journal/index.php?/archives/120-Planner-Statistics.html</guid>
	<link>http://www.postgresonline.com/journal/index.php?/archives/120-Planner-Statistics.html</link>
	<description>&lt;p&gt;You'll often hear the term planner statistics thrown around by database geeks.  &lt;em&gt;Did you update your statistics&lt;/em&gt;. This lingo isn't even limited
to PostgreSQL, but is part and parcel to how most decent databases work.  For example in PostgreSQL you do a &lt;code&gt;vacuum analyze&lt;/code&gt; to update your planner statistics in addition
to cleaning up dead space.  In SQL Server you do an &lt;code&gt;UPDATE STATISTICS&lt;/code&gt;. In MySQL you do an
&lt;code&gt;ANALYZE TABLE&lt;/code&gt; or a more invasive &lt;code&gt;OPTIMIZE TABLE&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;Normally all this &quot;update your stats so your planner can be happy&quot; is usually unnecessary unless
you just did a bulk load or a bulk delete or you are noticing your queries are  suddenly slowing down.  These stat things are generally updated behind the scenes by most databases
on an as needed basis.&lt;/p&gt;

&lt;p&gt;What makes SQL really interesting and a bit different from procedural languages is that it is declarative (like functional and logical programming languages) and relies on the database planner to come up with strategies for navigating the data.  Its strategy is not fixed as it is in  procedural languages.
A big part of this strategy is decided on by the query planner which looks at distributions of data.  Given different WHERE conditions for similar queries, it could come up with vastly different strategies if one value has a significantly
higher distribution in a table than another.  This is also the mystery of why it sometimes refuses to use an index on a field because it has decided a table scan is more efficient and also why some people consider HINTS evil because they pollute the imperative nature of the language.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/index.php?/archives/120-Planner-Statistics.html#extended&quot;&gt;Continue reading &quot;Planner Statistics&quot;&lt;/a&gt;</description>
	<pubDate>Tue, 09 Jun 2009 13:10:00 +0000</pubDate>
	<author>nospam@example.com (Leo Hsu and Regina Obe)</author>
</item>
<item>
	<title>Francisco Figueiredo Jr: Another postcard has arrived!</title>
	<guid>http://fxjr.blogspot.com/2009/06/another-postcard-has-arrived.html</guid>
	<link>http://fxjr.blogspot.com/2009/06/another-postcard-has-arrived.html</link>
	<description>Hi, all!&lt;br /&gt;&lt;br /&gt;Another postcard has arrived. It is from Transylvania:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_kiQW8YD8bZE/Si3JfHN6Q3I/AAAAAAAAAkM/ocrActYa0cA/s1600-h/IMG_0033.JPG&quot;&gt;&lt;img src=&quot;http://2.bp.blogspot.com/_kiQW8YD8bZE/Si3JfHN6Q3I/AAAAAAAAAkM/ocrActYa0cA/s200/IMG_0033.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5345149869109166962&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It is from Alin Hanghiuc (Update: Thanks for correction, Alin!) from Brasov, Romenia.&lt;br /&gt;&lt;br /&gt;Thank you very much, Alin for sending this postcard. This give us a lot of motivation!&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/15237920-3803927825345610282?l=fxjr.blogspot.com&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 09 Jun 2009 13:07:12 +0000</pubDate>
	<author>noreply@blogger.com (Francisco Figueiredo Jr.)</author>
</item>
<item>
	<title>Andrew Dunstan: Software kinda guy</title>
	<guid>http://people.planetpostgresql.org/andrew/index.php?/archives/24-Software-kinda-guy.html</guid>
	<link>http://people.planetpostgresql.org/andrew/index.php?/archives/24-Software-kinda-guy.html</link>
	<description>Some people drool over hardware specs, They will talk animatedly about drives and CPUs and such. &lt;br /&gt;
&lt;br /&gt;
I'm not one of these. In fact, I'm not really good with hardware at all. Discussions like the above leave me fairly bored. Elegant algorithms, and elegant expressions of algorithms, are things that interest and occasionally delight me. But not machine specs, and the like.&lt;br /&gt;
&lt;br /&gt;
Now that might surprise some in a person who has made his living with computers for about 25 years. But it's always been so. I recall at one stage of my career working on some machines that I had never seen, and I wouldn't have known what they looked like if I fell over them. They lived in the data centre or computer room or whatever it was called back then, and all I needed to know was how to drive them from my terminal. I knew some basics about the hardware, but nothing terribly specific.&lt;br /&gt;
&lt;br /&gt;
Perhaps this comes from the fact that I have never been very well coordinated physically (possibly a function of my bad vision, but possibly just genetic - it's been so from before high school), and so I tend to fumble things a lot. That doesn't matter too much when you can undo your typing in an editor, say, but it matters a lot when you're carrying things or plugging them in. I once saw someone drop a DASD pack, a rather expensive storage item back then for big iron machines, and maybe that too has frightened me a bit of getting too involved with hardware.&lt;br /&gt;
&lt;br /&gt;
Anyway, I think it's probably a sort of Mars/Venus thing. &lt;br /&gt;
&lt;br /&gt;
These thoughts have absolutely nothing to do with Postgres, except in the sense that they tell you something about why I spend my time working on it rather than on stuff closer to the metal. &lt;br /&gt;
&lt;br /&gt;
All this popped into my head while I was wrestling with hardware, of course. I'm converting an oldish laptop to be dual boot, and moving data from an old 100Gb drive to a new 320Gb drive. In the course of exploring the wonders of Windows file systems and cloning them, I must have swapped the old and new drives in and out half a dozen times, dropping screws along the way, and finding them again.&lt;br /&gt;
&lt;br /&gt;
The process is almost complete. I finally got it all working with a nice little package called &lt;a href=&quot;http://www.sysrescuecd.org&quot;&gt;SystemRescueCD&lt;/a&gt; which appears to do the job quite nicely. In particular, there's a package included there called &lt;a href=&quot;http://www.fsarchiver.org&quot;&gt;FSArchiver&lt;/a&gt; which seems to work very nicely. Soon I will have my daughter happily dual booting this laptop. (And no, a virtual Windows machine would not have done - some of the software needs to work direct with the hardware.)&lt;br /&gt;
&lt;br /&gt;
Now, back to work ...</description>
	<pubDate>Mon, 08 Jun 2009 17:49:53 +0000</pubDate>
	<author>nospam@example.com (Andrew Dunstan)</author>
</item>
<item>
	<title>David Wheeler: Need Help Naming Result Set Testing Functions</title>
	<guid>http://feedproxy.google.com/~r/justatheory/pgsum/~3/094OZnA4Ebo/result-testing-function-names.html</guid>
	<link>http://feedproxy.google.com/~r/justatheory/pgsum/~3/094OZnA4Ebo/result-testing-function-names.html</link>
	<description>&lt;div&gt;&lt;p&gt;I've been thinking more since I posted about &lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/comparing-relations.html&quot; title=&quot;Thoughts on Testing SQL Result Sets&quot;&gt;testing SQL result sets&lt;/a&gt;, and I think I've settled on two sets of functions for pgTAP: one that tests two SQL queries (though you will be encouraged to use a prepared statement), and one to test two cursors. I'm thinking of naming them:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://justatheory.com/computers/databases/postgresql/result-testing-function-names.html&quot;&gt;Read More »&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/justatheory/pgsum/~4/094OZnA4Ebo&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 08 Jun 2009 00:06:00 +0000</pubDate>
</item>
<item>
	<title>PostgreSQL Weekly News: PostgreSQL Weekly News June 7th 2009</title>
	<guid>http://www.postgresql.org/community/weeklynews/pwn20090607</guid>
	<link>http://www.postgresql.org/community/weeklynews/pwn20090607</link>
	<description>The CfP for PGCon Brazil is open!
&lt;a href=&quot;http://pgcon.postgresql.org.br/2009/chamadas.en.php&quot;&gt;http://pgcon.postgresql.org.br/2009/chamadas.en.php&lt;/a&gt;</description>
	<pubDate>Sun, 07 Jun 2009 08:00:00 +0000</pubDate>
</item>
<item>
	<title>Bruce Momjian: Challenges of Pg_Migrator</title>
	<guid>http://momjian.us/main/blogs/pgblog.html#June_6_2009</guid>
	<link>http://momjian.us/main/blogs/pgblog.html#June_6_2009</link>
	<description>&lt;p&gt;I just put out pg_migrator &lt;a href=&quot;http://pgfoundry.org/frs/?group_id=1000235&quot;&gt;beta2&lt;/a&gt;, with only small changes to the install file since
beta1.  The
&lt;a href=&quot;http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pg-migrator/pg_migrator/INSTALL?rev=1.25&amp;amp;content-type=text/x-cvsweb-markup&amp;amp;only_with_tag=MAIN&quot;&gt;install&lt;/a&gt;
file is critical to the success of pg_migrator.  Unlike the Postgres backend or libpq, pg_migrator relies on many external tools and
administrator actions, so detailed, accurate install instructions are essential for reliable migration.  Pg_Migrator is really not usable
without consulting the ten-step installation instructions.
&lt;/p&gt;</description>
	<pubDate>Sat, 06 Jun 2009 16:00:00 +0000</pubDate>
</item>
<item>
	<title>David Fetter: Materialized Views Performance Tips</title>
	<guid>http://people.planetpostgresql.org/dfetter/index.php?/archives/21-Materialized-Views-Performance-Tips.html</guid>
	<link>http://people.planetpostgresql.org/dfetter/index.php?/archives/21-Materialized-Views-Performance-Tips.html</link>
	<description>So you don't feel your clients' time is best spent on scanning a multi-million row table, and you've decided to materialize some views.  Here are some principles to keep in mind as you go forward... &lt;br /&gt;&lt;a href=&quot;http://people.planetpostgresql.org/dfetter/index.php?/archives/21-Materialized-Views-Performance-Tips.html#extended&quot;&gt;Continue reading &quot;Materialized Views Performance Tips&quot;&lt;/a&gt;</description>
	<pubDate>Sat, 06 Jun 2009 04:08:03 +0000</pubDate>
	<author>nospam@example.com (David Fetter)</author>
</item>
<item>
	<title>PDXPUG: PDXPUG June Meeting</title>
	<guid>http://pugs.postgresql.org/node/551</guid>
	<link>http://pugs.postgresql.org/node/551</link>
	<description>&lt;p&gt;June's meeting will be at the usual time (7pm), but will be held at OSBridge.  BoF format.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://opensourcebridge.org/sessions/274&quot; title=&quot;http://opensourcebridge.org/sessions/274&quot;&gt;http://opensourcebridge.org/sessions/274&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(You don't have to be a registered conference attendee for the BoF, so come on out!)&lt;/p&gt;</description>
	<pubDate>Fri, 05 Jun 2009 20:03:17 +0000</pubDate>
</item>
<item>
	<title>Magnus Hagander: Getting a range of entries centered around a point</title>
	<guid>http://blog.hagander.net/archives/147-Getting-a-range-of-entries-centered-around-a-point.html</guid>
	<link>http://blog.hagander.net/archives/147-Getting-a-range-of-entries-centered-around-a-point.html</link>
	<description>&lt;p&gt;I had a question yesterday on an internal IRC channel from one of my colleagues in Norway about a SQL query that would &amp;quot;for a given id value, return the 50 rows centered around the row with this id&amp;quot;, where the id column can contain gaps (either because they were inserted with gaps, or because there are further &lt;strong&gt;WHERE&lt;/strong&gt; restrictions in the query).&lt;/p&gt;

&lt;p&gt;I came up with a reasonably working solution fairly quickly, but I made one mistake. For fun, I asked around a number of my PostgreSQL contacts on IM and IRC for their solutions, and it turns out that almost everybody made the exact same mistake at first. I'm pretty sure all of them, like me, would've found and fixed that issue within seconds if they were in front of a psql console. But I figured that was a good excuse to write a blog post about it.&lt;/p&gt;

&lt;p&gt;The solution itself becomes pretty simple if you rephrase the problem as &amp;quot;for a given id value, return the 25 rows preceding and the 25 rows following the row with this id&amp;quot;. That pretty much spells a &lt;strong&gt;UNION&lt;/strong&gt; query. Thus, the solution to the problem is:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;&lt;div class=&quot;sql&quot;&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span&gt;SELECT&lt;/span&gt; * &lt;span&gt;FROM&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span&gt;SELECT&lt;/span&gt; id,field1,field2 &lt;span&gt;FROM&lt;/span&gt; mytable &lt;span&gt;WHERE&lt;/span&gt; id &amp;gt;= &lt;span&gt;123456&lt;/span&gt; &lt;span&gt;ORDER&lt;/span&gt; &lt;span&gt;BY&lt;/span&gt; id &lt;span&gt;LIMIT&lt;/span&gt; &lt;span&gt;26&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;AS&lt;/span&gt; a&lt;br /&gt;UNION &lt;span&gt;ALL&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span&gt;SELECT&lt;/span&gt; * &lt;span&gt;FROM&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span&gt;SELECT&lt;/span&gt; id,field1,field2 &lt;span&gt;FROM&lt;/span&gt; mytable &lt;span&gt;WHERE&lt;/span&gt; id &amp;lt; &lt;span&gt;123456&lt;/span&gt; &lt;span&gt;ORDER&lt;/span&gt; &lt;span&gt;BY&lt;/span&gt; id &lt;span&gt;DESC&lt;/span&gt; &lt;span&gt;LIMIT&lt;/span&gt; &lt;span&gt;25&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;AS&lt;/span&gt; b&lt;br /&gt;&lt;span&gt;ORDER&lt;/span&gt; &lt;span&gt;BY&lt;/span&gt; id;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The mistake everybody made? Forgetting that you need a subselect in order to use &lt;strong&gt;LIMIT&lt;/strong&gt;. Without subselects, you can't put &lt;strong&gt;ORDER BY&lt;/strong&gt; or &lt;strong&gt;LIMIT&lt;/strong&gt; inside the two separate parts of the query, only at the outer end of it. But we specifically need to apply the &lt;strong&gt;LIMIT&lt;/strong&gt; individually, and the &lt;strong&gt;ORDER BY&lt;/strong&gt; needs to be different for the two parts.&lt;/p&gt;

&lt;p&gt;Another question I got around this was, why use &lt;strong&gt;UNION ALL&lt;/strong&gt;. We know, after all, that there are no overlapping rows so the result should be the same as for &lt;strong&gt;UNION&lt;/strong&gt;. And this is exactly the reason why &lt;strong&gt;UNION ALL&lt;/strong&gt; should be used, rather than a plain &lt;strong&gt;UNION&lt;/strong&gt;. &lt;i&gt;We&lt;/i&gt; know it - the database doesn't. A &lt;strong&gt;UNION&lt;/strong&gt; query will generate a plan that requires an extra &lt;i&gt;unique&lt;/i&gt; node at the top, to make sure that there are no overlapping rows. So the tip here is - &lt;i&gt;always&lt;/i&gt; use &lt;strong&gt;UNION ALL&lt;/strong&gt; rather than &lt;strong&gt;UNION&lt;/strong&gt; whenever you &lt;i&gt;know&lt;/i&gt; that the results are not overlapping.&lt;/p&gt;

&lt;p&gt;All things considered, this query produces a pretty quick plan even for large datasets, since it allows us to do two independent index scans, one backwards. Since there are &lt;strong&gt;LIMIT&lt;/strong&gt; nodes on the scans, they will stop running as soon as they have produced the required number of rows, which is going to be very small compared to the size of the table. This is the query plan I got on my test data:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;&lt;div class=&quot;sql&quot;&gt;&lt;br /&gt;&amp;#160;Sort&amp;#160; &lt;span&gt;&amp;#40;&lt;/span&gt;cost=&lt;span&gt;54&lt;/span&gt;.&lt;span&gt;60&lt;/span&gt;..&lt;span&gt;54&lt;/span&gt;.&lt;span&gt;73&lt;/span&gt; rows=&lt;span&gt;51&lt;/span&gt; width=&lt;span&gt;86&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;Sort &lt;span&gt;KEY&lt;/span&gt;: id&lt;br /&gt;&amp;#160; &amp;#160;-&amp;gt;&amp;#160; Append&amp;#160; &lt;span&gt;&amp;#40;&lt;/span&gt;cost=&lt;span&gt;0&lt;/span&gt;.&lt;span&gt;00&lt;/span&gt;..&lt;span&gt;53&lt;/span&gt;.&lt;span&gt;15&lt;/span&gt; rows=&lt;span&gt;51&lt;/span&gt; width=&lt;span&gt;86&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;-&amp;gt;&amp;#160; &lt;span&gt;LIMIT&lt;/span&gt;&amp;#160; &lt;span&gt;&amp;#40;&lt;/span&gt;cost=&lt;span&gt;0&lt;/span&gt;.&lt;span&gt;00&lt;/span&gt;..&lt;span&gt;35&lt;/span&gt;.&lt;span&gt;09&lt;/span&gt; rows=&lt;span&gt;26&lt;/span&gt; width=&lt;span&gt;51&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;-&amp;gt;&amp;#160; &lt;span&gt;INDEX&lt;/span&gt; Scan &lt;span&gt;USING&lt;/span&gt; mytable_pk &lt;span&gt;ON&lt;/span&gt; mytable&amp;#160; &lt;span&gt;&amp;#40;&lt;/span&gt;cost=&lt;span&gt;0&lt;/span&gt;.&lt;span&gt;00&lt;/span&gt;..&lt;span&gt;55425&lt;/span&gt;.&lt;span&gt;06&lt;/span&gt; rows=&lt;span&gt;41062&lt;/span&gt; width=&lt;span&gt;51&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span&gt;INDEX&lt;/span&gt; Cond: &lt;span&gt;&amp;#40;&lt;/span&gt;id &amp;gt;= &lt;span&gt;100000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;-&amp;gt;&amp;#160; &lt;span&gt;LIMIT&lt;/span&gt;&amp;#160; &lt;span&gt;&amp;#40;&lt;/span&gt;cost=&lt;span&gt;0&lt;/span&gt;.&lt;span&gt;00&lt;/span&gt;..&lt;span&gt;17&lt;/span&gt;.&lt;span&gt;04&lt;/span&gt; rows=&lt;span&gt;25&lt;/span&gt; width=&lt;span&gt;51&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;-&amp;gt;&amp;#160; &lt;span&gt;INDEX&lt;/span&gt; Scan Backward &lt;span&gt;USING&lt;/span&gt; mytable_pk &lt;span&gt;ON&lt;/span&gt; mytable&amp;#160; &lt;span&gt;&amp;#40;&lt;/span&gt;cost=&lt;span&gt;0&lt;/span&gt;.&lt;span&gt;00&lt;/span&gt;..&lt;span&gt;56090&lt;/span&gt;.&lt;span&gt;47&lt;/span&gt; rows=&lt;span&gt;82306&lt;/span&gt; width=&lt;span&gt;51&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span&gt;INDEX&lt;/span&gt; Cond: &lt;span&gt;&amp;#40;&lt;/span&gt;id &amp;lt; &lt;span&gt;100000&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And yes, the final &lt;strong&gt;ORDER BY&lt;/strong&gt; is still needed if we want the total result to come out in the correct order. With the default query plan, it will come out in the wrong order after the &lt;i&gt;append&lt;/i&gt; node. But it's important to remember that by the specification the database is free to return the rows in &lt;i&gt;any order it chooses&lt;/i&gt; unless there is an explicit &lt;strong&gt;ORDER BY&lt;/strong&gt; in the query. The rows may otherwise be returned in a completely different order between different runs, depending on the size/width of the table and other parameters.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Jun 2009 13:26:00 +0000</pubDate>
	<author>nospam@example.com (Magnus Hagander)</author>
</item>
<item>
	<title>Josh Tolley: Inside PostgreSQL - Clause selectivity</title>
	<guid>http://blog.endpoint.com/2009/06/inside-postgresql-clause-selectivity.html</guid>
	<link>http://blog.endpoint.com/2009/06/inside-postgresql-clause-selectivity.html</link>
	<description>&lt;p&gt;One of the more valuable features of any conference is the so-called &quot;hall track&quot;, or in other words, the opportunity to talk to all sorts of people about all sorts of things. PGCon was no exception, and I found the hall track particularly interesting because of suggestions I was able to gather regarding multi-column statistics, not all of which boiled down to &quot;You're dreaming -- give it a rest&quot;. One of the problems I'd been trying to solve was where, precisely, to put the code that actually applies the statistics to a useful problem. There are several candidate locations, and certainly quite a few places where we could make use of such statistics. The lowest-hanging fruit, however, seems to be finding groups of query clauses that aren't as independent as we would normally assume. Between PGCon sessions one day, Tom Lane pointed me to a place where we already do something very similar: &lt;a href=&quot;http://doxygen.postgresql.org/clausesel_8c.html&quot;&gt;clausesel.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&quot;Clause selectivity&quot; means much the same thing as any other selectivity: it's the proportion of rows from a relation that an operation will return. A &quot;clause&quot;, in this case, is a filter on a relation, such as the &quot;X = 1&quot; and the &quot;Y  10&quot; in &quot;WHERE X = 1 AND Y  10&quot;. PostgreSQL uses functions in clausesel.c to find clauses whose combined selectivity differs from the product of their individual selectivities. For instance, in &quot;WHERE X  4 AND X  5&quot;, the &quot;X  5&quot; is redundant; the clauses' combined selectivity is simply that of &quot;X  4&quot;. With &quot;WHERE Y &gt; 4 AND Y  10&quot;, clausesel.c can determine that we really want the selectivity of the clause &quot;4  Y  10&quot;. It's also smart enough to recognize &quot;pseudo-constants&quot;: values from non-volatile functions, or from the outer relation of a nested loop. Although these values aren't truly constants, they remain constant at the level of the query where the clause will be applied, and can be treated as constants.&lt;/p&gt;
&lt;p&gt;With any luck, one day clausesel.c will also know enough to notice cases where, for instance, although &quot;foo.x = 3&quot; and &quot;foo.y &gt; 10&quot; are individually true for much of table &quot;foo&quot;, there are very few rows where both conditions are true.&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/7997313029981170997-6825723541607192698?l=blog.endpoint.com&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Fri, 05 Jun 2009 10:55:02 +0000</pubDate>
	<author>noreply@blogger.com (Joshua Tolley)</author>
</item>
<item>
	<title>Robert Treat: The First Rule of Postgres Club</title>
	<guid>http://www.xzilla.net/blog/2009/Jun/The-First-Rule-of-Postgres-Club.html</guid>
	<link>http://www.xzilla.net/blog/2009/Jun/The-First-Rule-of-Postgres-Club.html</link>
	<description>I had to chuckle when reading the comments of Alan Snelsons blog entry talking about &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=338&amp;amp;entry_id=468&quot; title=&quot;http://www.wave2.org/2009/06/03/postgresql-rock-solid-in-the-face-of-forking-mysql/&quot;&gt;PostgreSQL's project stability in the face of recent MySQL unsteadiness&lt;/a&gt;. Of course it shouldn't be a surprise that mentioning Postgres around MySQL people you might get some type of negative reaction. And vice versa of course. And with other db communities too, not just these two. But I digress. However what I really liked about the comments was this quote:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&quot;PostgreSQL vs. MySQL is a non-issue for most people because the decision is already made. I don’t know what’s the point in bringing that up every-time, it shines a bad light on the postgres community.&quot;&lt;/blockquote&gt;&lt;br /&gt;
The beauty here is that I found this blog post via &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=334&amp;amp;entry_id=468&quot; title=&quot;http://planet.mysql.com/&quot;&gt;Planet MySQL&lt;/a&gt;, not &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=335&amp;amp;entry_id=468&quot; title=&quot;http://planet.postgresql.org&quot;&gt;Planet Postgres&lt;/a&gt;. Further I've never heard of Alan Snelson; the post's author; he hasn't spoken at a Postgres event, and isn't syndicated on Planet Postgres. As far as I know, he just some guy who uses MySQL a lot, and now is looking at Postgres. Apparently he likes it and wants to spread the word. And of course people who don't like hearing about Postgres use this as a mark against the Postgres community, even when the Postgres project has nothing to do with it. You know software is no good when people who use it want to tell you how awesome it is! &lt;img src=&quot;http://www.xzilla.net/templates/default/img/emoticons/tongue.png&quot; alt=&quot;:-P&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
In truth, that's how a lot of Postgres advocacy works these days. When you see people posting on slashdot, most of the time it's not from people working directly with the project. For those of us who have been using Postgres for a long time, we've long since got the message that MySQL users don't want to hear about Postgres. When I sat in the MariaDB feature request round table at the &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=336&amp;amp;entry_id=468&quot; title=&quot;http://conferences.percona.com/percona-performance-conference-2009/schedule.html&quot;&gt;Percona Performance conference&lt;/a&gt;, listening to people ask for feature after feature that Postgres already has; partial indexes, index fillfactor, online ddl, extensible data types, dtrace probes, PITR, the list goes on; I didn't wave the Postgres banner. The only time I spoke about Postgres was when &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=337&amp;amp;entry_id=468&quot; title=&quot;http://monty-says.blogspot.com/&quot;&gt;Monty&lt;/a&gt; had questions about Postgres' implementation. Some people asked me why I wasn't more vocal, why didn't I tell everyone about all the wonderful things that Postgres can do? What can I say... it's the first rule of Postgres club. &lt;br /&gt;
&lt;br /&gt;</description>
	<pubDate>Fri, 05 Jun 2009 04:04:00 +0000</pubDate>
	<author>nospam@example.com (Robert Treat)</author>
</item>
<item>
	<title>Bruce Momjian: Pg_Migrator Beta 1 Released</title>
	<guid>http://momjian.us/main/blogs/pgblog.html#June_4_2009_2</guid>
	<link>http://momjian.us/main/blogs/pgblog.html#June_4_2009_2</link>
	<description>&lt;p&gt;I have released pg_migrator &lt;a href=&quot;http://pgfoundry.org/frs/?group_id=1000235&quot;&gt;beta1&lt;/a&gt; today.  All outstanding issues have been addressed and
I expect a brief beta period, perhaps a week, before pg_migrator 8.4 final is released.
&lt;/p&gt;</description>
	<pubDate>Thu, 04 Jun 2009 16:00:00 +0000</pubDate>
</item>
<item>
	<title>Bruce Momjian: Back to Email</title>
	<guid>http://momjian.us/main/blogs/pgblog.html#June_4_2009</guid>
	<link>http://momjian.us/main/blogs/pgblog.html#June_4_2009</link>
	<description>&lt;p&gt;I have not read much email since the beginning of May --- that's when I started working on
&lt;a href=&quot;http://pgfoundry.org/projects/pg-migrator/&quot;&gt;pg_migrator&lt;/a&gt;, then I attended &lt;a href=&quot;http://www.pgcon.org/2009/&quot;&gt;PGCon&lt;/a&gt;, and then I did a
week of training for &lt;a href=&quot;http://www.enterprisedb.com/&quot;&gt;EnterpriseDB&lt;/a&gt;.  Only on May 30 was I able to devote full-time effort to reading
Postgres email; by that time my unread email had grown to 3,000 messages.  So for a week I only read email and have now caught up.  You
can actually see this in my &lt;a href=&quot;http://momjian.us/main/img.html?pgunread.gif&quot;&gt;graph&lt;/a&gt; of unread email.
&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://momjian.us/main/blogs/pgblog.html#June_4_2009&quot;&gt;Read More &amp;raquo;&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Thu, 04 Jun 2009 16:00:00 +0000</pubDate>
</item>
<item>
	<title>Robert Treat: Guide to Postgres 8.4 video now available</title>
	<guid>http://www.xzilla.net/blog/2009/Jun/Guide-to-Postgres-8.4-video-now-available.html</guid>
	<link>http://www.xzilla.net/blog/2009/Jun/Guide-to-Postgres-8.4-video-now-available.html</link>
	<description>For those looking for more information on the &quot;Guide to Postgres 8.4&quot; talk I have been giving recently, I thought I'd put up a few pointers to the information now available. First, there is now &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=330&amp;amp;entry_id=467&quot; title=&quot;http://hosting3.epresence.tv/fosslc/1/watch/142.aspx&quot;&gt;video available online&lt;/a&gt; from the presentation I gave at PGCon. It contains audio, video, and the slide stack to go with it. For some reason the audio feed doesn't work on my MacBook, though it does seem fine from my Linux box, so if you can get audio, it should be ok. I also noticed that some of the slides were cut in odd ways, so if you want the full slide stack from the talk, thats available on the &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=331&amp;amp;entry_id=467&quot; title=&quot;http://www.pgcon.org/2009/schedule/events/179.en.html&quot;&gt;PGCon website talk page&lt;/a&gt;. There's also a slightly longer slide stack from a 3 hour version of this talk I gave at PGEast which I made &lt;a href=&quot;http://www.xzilla.net/exit.php?url_id=332&amp;amp;entry_id=467&quot; title=&quot;http://www.slideshare.net/xzilla/postgres-84-tutorial&quot;&gt;available at slideshare&lt;/a&gt;. There was supposed to be video of that session made available, but I haven't seen it yet, once it's up, I'll let you know. Hope this helps, and good luck with Postgres 8.4.</description>
	<pubDate>Thu, 04 Jun 2009 03:39:00 +0000</pubDate>
	<author>nospam@example.com (Robert Treat)</author>
</item>
<item>
	<title>US PostgreSQL Association: DenverPUG/PgUS meeting rescheduled</title>
	<guid>http://www.postgresql.us/node/88</guid>
	<link>http://www.postgresql.us/node/88</link>
	<description>&lt;p&gt;JD wrote:&lt;/p&gt;
&lt;p&gt;The June DenverPUG meeting that I was going to attend has been rescheduled due to summer conflicts. The current anticipated date is August. Stay tuned!&lt;/p&gt;</description>
	<pubDate>Wed, 03 Jun 2009 17:31:44 +0000</pubDate>
</item>

</channel>
</rss>
