<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Light Year Blog &#187; pgsql_stats</title>
	<atom:link href="http://lightyearsoftware.com/blog/category/coding/pgsql_stats/feed/" rel="self" type="application/rss+xml" />
	<link>http://lightyearsoftware.com/blog</link>
	<description>Thoughts on Rails, iPhone and software consulting from a Columbus indie developer.</description>
	<lastBuildDate>Thu, 09 Sep 2010 02:46:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sample View Code for pgsql_stats Example</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2007%2F09%2Fsample-view-code-for-pgsql_stats-example%2F&amp;seed_title=Sample+View+Code+for+pgsql_stats+Example</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2007%2F09%2Fsample-view-code-for-pgsql_stats-example%2F&amp;seed_title=Sample+View+Code+for+pgsql_stats+Example#comments</comments>
		<pubDate>Tue, 04 Sep 2007 20:43:32 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby & Rails]]></category>
		<category><![CDATA[pgsql_stats]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/2007/09/sample-view-code-for-pgsql_stats-example/</guid>
		<description><![CDATA[A couple of people have asked how to achieve the results I showed off in my posting about the pgsql_stats plug-in. I just posted an example use page on the pgsql_stats Google Group that shows the controller and view code used to create that screenshot. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>A couple of people have asked how to achieve the results I showed off in my posting about the <a href="http://lightyearsoftware.com/blog/2007/08/collecting-statistics-from-postgresql-in-rails/">pgsql_stats plug-in</a>.  I just posted an <a href="http://groups.google.com/group/pgsql_stats/web/use-example">example use page</a> on the <a href="http://groups.google.com/group/pgsql_stats">pgsql_stats Google Group</a> that shows the controller and view code used to create that screenshot.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2007%2F09%2Fsample-view-code-for-pgsql_stats-example%2F&amp;seed_title=Sample+View+Code+for+pgsql_stats+Example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Collecting Statistics from PostgreSQL in Rails</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2007%2F08%2Fcollecting-statistics-from-postgresql-in-rails%2F&amp;seed_title=Collecting+Statistics+from+PostgreSQL+in+Rails</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2007%2F08%2Fcollecting-statistics-from-postgresql-in-rails%2F&amp;seed_title=Collecting+Statistics+from+PostgreSQL+in+Rails#comments</comments>
		<pubDate>Mon, 13 Aug 2007 14:21:13 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby & Rails]]></category>
		<category><![CDATA[pgsql_stats]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/2007/08/collecting-statistics-from-postgresql-in-rails/</guid>
		<description><![CDATA[The PostgreSQL database includes a statistics collection facility that can give you information about your database, tables, indexes and sequences. I just posted a new Rails plug-in that makes it very easy to gather this information and display it in a Rails application. All of the counters described in the PostgreSQL manual are represented in [...]]]></description>
			<content:encoded><![CDATA[<p>The PostgreSQL database includes a statistics collection facility that can give you information about your database, tables, indexes and sequences.  I just posted a new Rails plug-in that makes it very easy to gather this information and display it in a Rails application.</p>
<p><a href='http://lightyearsoftware.com/blog/wp-content/uploads/2007/08/pgsql_stats.png' title='pgsql_stats screenshot'><img src='http://lightyearsoftware.com/blog/wp-content/uploads/2007/08/pgsql_stats.png' alt='pgsql_stats screenshot' style="width:100%;"/></a></p>
<p>All of the counters described in the <a href="http://www.postgresql.org/docs/8.2/static/monitoring-stats.html#MONITORING-STATS-VIEWS">PostgreSQL manual</a> are represented in the models in the plug-in.  To name a few:</p>
<ul>
<li>Number of scans over the table or index</li>
<li>Cache hit/miss counters (and cache hit rate, by a simple computation)</li>
<li>On-disk size</li>
</ul>
<p>In the above screenshot (taken very soon after the server was started), it&#8217;s easy to see that the cron_runs table is by far the largest in the database, followed by its primary key index.  Of the entities that have been touched, a large percentage of requests are being satisfied by the buffer cache.  You can&#8217;t see it in that image, but I&#8217;ve defined ranges that turn the green bars red if the cache hit rate falls below 75%.</p>
<p>I&#8217;ve set up a <del datetime="2008-07-23T15:58:01+00:00">Google Group</del> <a href="http://forums.lightyearsoftware.com/viewforum.php?id=5">forum</a> for further discussion.  Some additional information is available in the <a href="http://svn.lightyearsoftware.com/svn/plugins/pgsql_stats/README">README</a>, and the plug-in can be installed like any other:</p>
<p><code>$ script/plugin install \ http://svn.lightyearsoftware.com/svn/plugins/pgsql_stats</code></p>
<p>All on one line, of course.</p>
<p><strong>Update Sep. 10, 2007:</strong> There is now a usage example on the Google Group that shows how to get the results shown in the screenshot.</p>
<p><strong>Update Jul. 23, 2008:</strong> Part of the fallout of Google <a href="http://lightyearsoftware.com/blog/2008/05/advertising-and-making-money-online/">disabling my account</a> appears to be that the group I set up for discussion and support disappeared, too.  I have moved discussion and support to my own forums: <a href="http://forums.lightyearsoftware.com/viewforum.php?f=9">pgsql_stats forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2007%2F08%2Fcollecting-statistics-from-postgresql-in-rails%2F&amp;seed_title=Collecting+Statistics+from+PostgreSQL+in+Rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
