<?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>Xaprb &#187; PostgreSQL</title>
	<atom:link href="http://www.xaprb.com/blog/category/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog</link>
	<description>Stay curious!</description>
	<lastBuildDate>Mon, 23 Aug 2010 23:00:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>There&#8217;s a European OpenSQL Camp coming up</title>
		<link>http://www.xaprb.com/blog/2010/06/29/theres-a-european-opensql-camp-coming-up/</link>
		<comments>http://www.xaprb.com/blog/2010/06/29/theres-a-european-opensql-camp-coming-up/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 12:32:53 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[OpenSQL Camp]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[cassandra]]></category>
		<category><![CDATA[Giuseppe Maxia]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1905</guid>
		<description><![CDATA[In addition to the Boston edition, there&#8217;s an OpenSQL Camp at the same time and place as FrOSCon mid-August in Germany.  The call for papers is open until July 11th.  As always, the conference is about all kinds of open-source databases: MySQL and PostgreSQL are only two of the obvious ones; MongoDB and [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/06/25/opensql-camp-boston-2010/' rel='bookmark' title='Permanent Link: OpenSQL Camp Boston 2010'>OpenSQL Camp Boston 2010</a></li><li><a href='http://www.xaprb.com/blog/2009/08/29/opensql-camp-events-in-2009/' rel='bookmark' title='Permanent Link: OpenSQL Camp events in 2009'>OpenSQL Camp events in 2009</a></li><li><a href='http://www.xaprb.com/blog/2009/11/17/recap-of-portland-opensql-camp-2009/' rel='bookmark' title='Permanent Link: Recap of Portland OpenSQL Camp 2009'>Recap of Portland OpenSQL Camp 2009</a></li><li><a href='http://www.xaprb.com/blog/2010/04/18/the-history-of-opensql-camp/' rel='bookmark' title='Permanent Link: The history of OpenSQL Camp'>The history of OpenSQL Camp</a></li><li><a href='http://www.xaprb.com/blog/2008/09/17/opensql-camp-develops-further/' rel='bookmark' title='Permanent Link: OpenSQL Camp develops further'>OpenSQL Camp develops further</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>In addition to the Boston edition, there&#8217;s an <a href="http://opensqlcamp.org/Events/FrOSCon2010/">OpenSQL Camp at the same time and place as FrOSCon</a> mid-August in Germany.  The call for papers is open until July 11th.  As always, the conference is about all kinds of open-source databases: MySQL and PostgreSQL are only two of the obvious ones; MongoDB and Cassandra featured prominently at the last one I attended, and SQLite was well represented at the first one.</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/06/25/opensql-camp-boston-2010/' rel='bookmark' title='Permanent Link: OpenSQL Camp Boston 2010'>OpenSQL Camp Boston 2010</a></li><li><a href='http://www.xaprb.com/blog/2009/08/29/opensql-camp-events-in-2009/' rel='bookmark' title='Permanent Link: OpenSQL Camp events in 2009'>OpenSQL Camp events in 2009</a></li><li><a href='http://www.xaprb.com/blog/2009/11/17/recap-of-portland-opensql-camp-2009/' rel='bookmark' title='Permanent Link: Recap of Portland OpenSQL Camp 2009'>Recap of Portland OpenSQL Camp 2009</a></li><li><a href='http://www.xaprb.com/blog/2010/04/18/the-history-of-opensql-camp/' rel='bookmark' title='Permanent Link: The history of OpenSQL Camp'>The history of OpenSQL Camp</a></li><li><a href='http://www.xaprb.com/blog/2008/09/17/opensql-camp-develops-further/' rel='bookmark' title='Permanent Link: OpenSQL Camp develops further'>OpenSQL Camp develops further</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/06/29/theres-a-european-opensql-camp-coming-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Southeast Linux Fest is around the corner</title>
		<link>http://www.xaprb.com/blog/2010/06/03/southeast-linux-fest-is-around-the-corner/</link>
		<comments>http://www.xaprb.com/blog/2010/06/03/southeast-linux-fest-is-around-the-corner/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 12:37:34 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1890</guid>
		<description><![CDATA[If you&#8217;re near South Carolina next weekend, consider attending Southeast Linux Fest!  There&#8217;s a list of illustrious speakers including several well-known in the database world: Joshua Drake and Andrew Dunstan (PostgreSQL), D. Richard Hipp (SQLite), and yes, yours truly (MySQL), plus a MySQL name that&#8217;s new to me: Brandon Checketts.  There are a [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2009/06/21/recap-of-southeast-linux-fest-2009/' rel='bookmark' title='Permanent Link: Recap of Southeast Linux Fest 2009'>Recap of Southeast Linux Fest 2009</a></li><li><a href='http://www.xaprb.com/blog/2010/01/09/how-linux-iostat-computes-its-results/' rel='bookmark' title='Permanent Link: How Linux iostat computes its results'>How Linux iostat computes its results</a></li><li><a href='http://www.xaprb.com/blog/2009/08/23/how-to-find-per-process-io-statistics-on-linux/' rel='bookmark' title='Permanent Link: How to find per-process I/O statistics on Linux'>How to find per-process I/O statistics on Linux</a></li><li><a href='http://www.xaprb.com/blog/2006/06/08/how-to-monitor-server-load-on-gnulinux/' rel='bookmark' title='Permanent Link: How to monitor server load on GNU/Linux'>How to monitor server load on GNU/Linux</a></li><li><a href='http://www.xaprb.com/blog/2006/05/20/how-to-auto-mount-removable-devices-in-gnulinux/' rel='bookmark' title='Permanent Link: How to auto-mount removable devices in GNU/Linux'>How to auto-mount removable devices in GNU/Linux</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re near South Carolina next weekend, consider attending <a href="http://southeastlinuxfest.org/">Southeast Linux Fest</a>!  There&#8217;s a list of illustrious speakers including several well-known in the database world: Joshua Drake and Andrew Dunstan (PostgreSQL), D. Richard Hipp (SQLite), and yes, yours truly (MySQL), plus a MySQL name that&#8217;s new to me: Brandon Checketts.  There are a ton of non-database sessions too!  Check out the <a href="http://www.southeastlinuxfest.org/node/62">full speaker &#038; session list</a>.  This was a great show last year; I highly encourage everyone to attend.</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2009/06/21/recap-of-southeast-linux-fest-2009/' rel='bookmark' title='Permanent Link: Recap of Southeast Linux Fest 2009'>Recap of Southeast Linux Fest 2009</a></li><li><a href='http://www.xaprb.com/blog/2010/01/09/how-linux-iostat-computes-its-results/' rel='bookmark' title='Permanent Link: How Linux iostat computes its results'>How Linux iostat computes its results</a></li><li><a href='http://www.xaprb.com/blog/2009/08/23/how-to-find-per-process-io-statistics-on-linux/' rel='bookmark' title='Permanent Link: How to find per-process I/O statistics on Linux'>How to find per-process I/O statistics on Linux</a></li><li><a href='http://www.xaprb.com/blog/2006/06/08/how-to-monitor-server-load-on-gnulinux/' rel='bookmark' title='Permanent Link: How to monitor server load on GNU/Linux'>How to monitor server load on GNU/Linux</a></li><li><a href='http://www.xaprb.com/blog/2006/05/20/how-to-auto-mount-removable-devices-in-gnulinux/' rel='bookmark' title='Permanent Link: How to auto-mount removable devices in GNU/Linux'>How to auto-mount removable devices in GNU/Linux</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/06/03/southeast-linux-fest-is-around-the-corner/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Under-provisioning: the curse of the cloud</title>
		<link>http://www.xaprb.com/blog/2010/06/01/under-provisioning-the-curse-of-the-cloud/</link>
		<comments>http://www.xaprb.com/blog/2010/06/01/under-provisioning-the-curse-of-the-cloud/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 01:31:46 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Theo Schlossnagle]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1884</guid>
		<description><![CDATA[A common problem I see people running into when using a cloud computing service is the trap of under-provisioning.  There&#8217;s a chain effect that leads to this result: 1) people don&#8217;t understand how virtualization works, and therefore 2) they don&#8217;t realize how much of a computing resource they&#8217;re really buying, so 3) they assume [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/07/04/a-review-of-cloud-application-architectures-by-george-reese/' rel='bookmark' title='Permanent Link: A review of Cloud Application Architectures by George Reese'>A review of Cloud Application Architectures by George Reese</a></li><li><a href='http://www.xaprb.com/blog/2008/08/21/drizzle-stops-the-rain/' rel='bookmark' title='Permanent Link: Drizzle stops the rain'>Drizzle stops the rain</a></li><li><a href='http://www.xaprb.com/blog/2009/04/17/sessions-of-interest-at-the-percona-performance-conference/' rel='bookmark' title='Permanent Link: Sessions of interest at the Percona Performance Conference'>Sessions of interest at the Percona Performance Conference</a></li><li><a href='http://www.xaprb.com/blog/2009/05/05/why-mysql-might-not-benefit-from-having-a-mother-ship/' rel='bookmark' title='Permanent Link: Why MySQL might not benefit from having a mother ship'>Why MySQL might not benefit from having a mother ship</a></li><li><a href='http://www.xaprb.com/blog/2008/05/21/i-moved-this-blog-to-pairlite-with-zero-downtime-and-it-was-easy/' rel='bookmark' title='Permanent Link: I moved this blog to pairLite with zero downtime, and it was easy'>I moved this blog to pairLite with zero downtime, and it was easy</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>A common problem I see people running into when using a cloud computing service is the trap of under-provisioning.  There&#8217;s a chain effect that leads to this result: 1) people don&#8217;t understand how virtualization works, and therefore 2) they don&#8217;t realize how much of a computing resource they&#8217;re really buying, so 3) they assume they are entitled to more than they really are, and 4) they under-provision.  A few other causes and effects come into play here, too.  For example, the choice to use the cloud is sometimes founded on economic assumptions that frequently turn out to be wrong.  The cloud service looks more economically attractive than it really is, due to under-provisioning.</p>

<p>Let&#8217;s get back to this idea that people under-provision.  How do I know that&#8217;s happening?  I&#8217;ll use anecdotal evidence to illustrate.  Here&#8217;s a real quote from a recent engagement about database (MySQL) performance problems:</p>

<blockquote><p>Do you think it&#8217;s likely that the underlying hardware is simply worse than average? If you think this will be an ongoing problem, maybe we should try our luck with a new instance/storage cluster?</p></blockquote>

<p>The fundamental assumption here is that some clusters are overloaded and are giving poor quality of service.  We&#8217;re trained to think this way because we are familiar with services such as shared hosting, where other users on your particular server might really be abusive and claim resources that should be yours.  But this isn&#8217;t how virtualization works in the common cloud platforms.  In these platforms, you aren&#8217;t sharing resources with other users.  You are guaranteed to get what you deserve!  No kidding &#8212; this actually works.</p>

<p>If that&#8217;s true, then why does performance fluctuate so much?  The answer lies in how resources are parceled out.  Assume there are 10 units of computing resources, and you&#8217;re paying for one of them.  You buy 1/10th of the machine&#8217;s power.  But it just happens that you&#8217;re the only virtual instance running on that physical server.  You fire up an intense job.  How much power do you get?  You paid for 1 unit, <strong>but you get 10, because no one else is using the other 9 units.</strong>  This is the way most virtualization platforms work: they give you extra resources if they&#8217;re available and not being claimed by anyone else&#8217;s instance.  This guarantees that you&#8217;ll never get less than you deserve, but it leaves open the possibility that you&#8217;ll get more than you deserve.  (What would be the point of wasting that power, really?)  Under-provisioning is the obverse of over-providing, which is what the virtualization platform does.</p>

<p>First-generation hyperthreading gave the same illusion of more resources than are really available, by the way.  It made you think there were multiple processors, when in fact there weren&#8217;t &#8212; there were multiple sets of registers.  Hyperthreading is a form of virtualization, too.</p>

<p>What typically happens is that people are running their cloud instances on machines whose underlying physical hardware is not fully utilized, and they get used to a certain level of performance they&#8217;re not really paying for.  Alas, you can&#8217;t really know whether this is happening or not!  But it surely is in many (most?) cases, which is why occasionally you get some resource that seems much slower than you&#8217;re accustomed to, and you think it&#8217;s &#8220;too slow.&#8221; Not so.  Your other units are &#8220;too fast.&#8221;</p>

<p>I have a theory that if you really knew the true capacity you were buying, you&#8217;d view the price-to-performance ratio much less favorably.  But it&#8217;s almost impossible to know that, really; it doesn&#8217;t help that the cloud service providers are rather vague about how much power a certain instance size really gives you.  (They aren&#8217;t being malicious; it&#8217;s just the way virtualization works.)  Under-provisioning is almost forced on users because they have no alternative &#8212; you could plan for worst-case performance, and you&#8217;d be doing the right thing, but how will you ever know you&#8217;ve really hit rock bottom and the worst case is really no worse?  How can you even benchmark and do proper capacity planning, if you don&#8217;t know what you&#8217;re benchmarking?  This should really give you serious pause.  You should be thinking &#8220;wait, I&#8217;m basing my capacity planning and provisioning on luck and the law of large numbers.  What if my luck runs out and I get a Black Swan event?&#8221;  The question is not &#8220;what if,&#8221; but &#8220;when.&#8221;</p>

<p>I also think that the lack of transparency encourages people to use cloud computing services for the wrong reasons altogether.  I could write about this, but I think <a href="http://lethargy.org/~jesus/writes/thoughts-on-the-cloud">Theo Schlossnagle said it pretty well already</a>.</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2010/07/04/a-review-of-cloud-application-architectures-by-george-reese/' rel='bookmark' title='Permanent Link: A review of Cloud Application Architectures by George Reese'>A review of Cloud Application Architectures by George Reese</a></li><li><a href='http://www.xaprb.com/blog/2008/08/21/drizzle-stops-the-rain/' rel='bookmark' title='Permanent Link: Drizzle stops the rain'>Drizzle stops the rain</a></li><li><a href='http://www.xaprb.com/blog/2009/04/17/sessions-of-interest-at-the-percona-performance-conference/' rel='bookmark' title='Permanent Link: Sessions of interest at the Percona Performance Conference'>Sessions of interest at the Percona Performance Conference</a></li><li><a href='http://www.xaprb.com/blog/2009/05/05/why-mysql-might-not-benefit-from-having-a-mother-ship/' rel='bookmark' title='Permanent Link: Why MySQL might not benefit from having a mother ship'>Why MySQL might not benefit from having a mother ship</a></li><li><a href='http://www.xaprb.com/blog/2008/05/21/i-moved-this-blog-to-pairlite-with-zero-downtime-and-it-was-easy/' rel='bookmark' title='Permanent Link: I moved this blog to pairLite with zero downtime, and it was easy'>I moved this blog to pairLite with zero downtime, and it was easy</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/06/01/under-provisioning-the-curse-of-the-cloud/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Optimal performance out of the box!</title>
		<link>http://www.xaprb.com/blog/2010/05/12/optimal-performance-out-of-the-box/</link>
		<comments>http://www.xaprb.com/blog/2010/05/12/optimal-performance-out-of-the-box/#comments</comments>
		<pubDate>Wed, 12 May 2010 12:25:07 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1836</guid>
		<description><![CDATA[Most database companies would be proud to say that their products perform optimally out of the box.  It means they accomplished a Herculean feat of engineering.  But most databases have configuration options because this is almost impossible.  For example, MySQL has scores of tuning options, and it needs a lot more.

So when [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2006/05/04/how-to-make-a-program-choose-an-optimal-polling-interval/' rel='bookmark' title='Permanent Link: How to make a program choose an optimal polling interval'>How to make a program choose an optimal polling interval</a></li><li><a href='http://www.xaprb.com/blog/2007/10/07/high-performance-mysql-second-edition-query-performance-optimization/' rel='bookmark' title='Permanent Link: High Performance MySQL, Second Edition: Query Performance Optimization'>High Performance MySQL, Second Edition: Query Performance Optimization</a></li><li><a href='http://www.xaprb.com/blog/2009/11/07/a-review-of-optimizing-oracle-performance-by-cary-millsap/' rel='bookmark' title='Permanent Link: A review of Optimizing Oracle Performance by Cary Millsap'>A review of Optimizing Oracle Performance by Cary Millsap</a></li><li><a href='http://www.xaprb.com/blog/2010/02/22/cary-millsap-thinking-clearly-about-performance/' rel='bookmark' title='Permanent Link: Cary Millsap: Thinking Clearly about Performance'>Cary Millsap: Thinking Clearly about Performance</a></li><li><a href='http://www.xaprb.com/blog/2010/05/01/a-review-of-forecasting-oracle-performance-by-craig-shallahamer/' rel='bookmark' title='Permanent Link: A review of Forecasting Oracle Performance by Craig Shallahamer'>A review of Forecasting Oracle Performance by Craig Shallahamer</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Most database companies would be proud to say that their products perform optimally out of the box.  It means they accomplished a Herculean feat of engineering.  But most databases have configuration options because this is almost impossible.  For example, MySQL has scores of tuning options, and it needs a lot more.</p>

<p>So when someone benchmarks your database and makes you look bad, usually you can say &#8220;that benchmark was run by someone who doesn&#8217;t know how to properly tune my database software.&#8221;</p>

<p>But what if the benchmarker claims that <a href="http://www.redhat.com/pdf/rhel/bmsql-postgres-sqlsrvr-v1.0-1.pdf">your database didn&#8217;t <strong>need</strong> to be tuned</a>, (via <a href="http://pgsnake.blogspot.com/2010/05/postgres-vs-sql-server.html">Dave Page</a>), because it&#8217;s optimal out of the box?  Do you accept the benchmark results, or reject the compliment?</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2006/05/04/how-to-make-a-program-choose-an-optimal-polling-interval/' rel='bookmark' title='Permanent Link: How to make a program choose an optimal polling interval'>How to make a program choose an optimal polling interval</a></li><li><a href='http://www.xaprb.com/blog/2007/10/07/high-performance-mysql-second-edition-query-performance-optimization/' rel='bookmark' title='Permanent Link: High Performance MySQL, Second Edition: Query Performance Optimization'>High Performance MySQL, Second Edition: Query Performance Optimization</a></li><li><a href='http://www.xaprb.com/blog/2009/11/07/a-review-of-optimizing-oracle-performance-by-cary-millsap/' rel='bookmark' title='Permanent Link: A review of Optimizing Oracle Performance by Cary Millsap'>A review of Optimizing Oracle Performance by Cary Millsap</a></li><li><a href='http://www.xaprb.com/blog/2010/02/22/cary-millsap-thinking-clearly-about-performance/' rel='bookmark' title='Permanent Link: Cary Millsap: Thinking Clearly about Performance'>Cary Millsap: Thinking Clearly about Performance</a></li><li><a href='http://www.xaprb.com/blog/2010/05/01/a-review-of-forecasting-oracle-performance-by-craig-shallahamer/' rel='bookmark' title='Permanent Link: A review of Forecasting Oracle Performance by Craig Shallahamer'>A review of Forecasting Oracle Performance by Craig Shallahamer</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/05/12/optimal-performance-out-of-the-box/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>4 ways that instrumentation is like sex</title>
		<link>http://www.xaprb.com/blog/2010/03/30/4-ways-that-instrumentation-is-like-sex/</link>
		<comments>http://www.xaprb.com/blog/2010/03/30/4-ways-that-instrumentation-is-like-sex/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 03:57:36 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[instrumentation]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1715</guid>
		<description><![CDATA[In an application such as a database server, instrumentation is like sex: it&#8217;s not enough to know how often things happen.  You also care about how long they took, and in many cases you want to know how big they were.

&#8220;Things&#8221; are the things you want to optimize.  Want to optimize queries?  [...]


Related posts:<ol><li><a href='http://www.xaprb.com/blog/2009/02/12/5-ways-to-make-hexadecimal-identifiers-perform-better-on-mysql/' rel='bookmark' title='Permanent Link: 5 ways to make hexadecimal identifiers perform better on MySQL'>5 ways to make hexadecimal identifiers perform better on MySQL</a></li><li><a href='http://www.xaprb.com/blog/2006/07/19/3-ways-to-maintain-rollup-tables-in-sql/' rel='bookmark' title='Permanent Link: 3 ways to maintain rollup tables in SQL'>3 ways to maintain rollup tables in SQL</a></li><li><a href='http://www.xaprb.com/blog/2006/06/17/3-ways-to-write-upsert-and-merge-queries-in-mysql/' rel='bookmark' title='Permanent Link: 3 ways to write UPSERT and MERGE queries in MySQL'>3 ways to write UPSERT and MERGE queries in MySQL</a></li><li><a href='http://www.xaprb.com/blog/2009/09/27/6-ways-to-stay-sane-while-working-from-home/' rel='bookmark' title='Permanent Link: 6 ways to stay sane while working from home'>6 ways to stay sane while working from home</a></li><li><a href='http://www.xaprb.com/blog/2010/03/28/the-need-for-tunability-and-measurability/' rel='bookmark' title='Permanent Link: The need for tunability and measurability'>The need for tunability and measurability</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>In an application such as a database server, instrumentation is like sex: it&#8217;s not enough to know how often things happen.  You also care about how long they took, and in many cases you want to know how big they were.</p>

<p>&#8220;Things&#8221; are the things you want to optimize.  Want to optimize queries?  Then you need to know what activities that query causes to happen.  Most systems have at least some of this kind of instrumentation.  If you look around at&#8230; let&#8217;s not pick on the usual targets&#8230; oh, say Sphinx, Redis, and memcached.  What metrics do they provide?  They provide counters that say how often various things happened.  (Most of these systems provide very few and coarse-grained counters.)  That&#8217;s not very helpful.  So I read from disk N times, and I read from memory N times, and I compared rows N times&#8230; so what?  I still don&#8217;t know anything relevant to execution time.</p>

<p>That&#8217;s why we need to measure how long things took.  It&#8217;d be great if, for every Handler_X counter variable in MySQL&#8217;s SHOW STATUS, we also had a Handler_X_time in microseconds.  True, better instrumentation could be designed, but that&#8217;d be a huge step forward already.  Instead of guessing at the significance of Sort_rows, we could look at Sort_rows_time and see if a lot of time is being consumed sorting rows!.</p>

<p>Next, we need to know how big things are.  This is a rather generic term, but in a lot of cases, the size, difficulty, or some other metric of an operation is important.  &#8220;I wrote a message to the network socket&#8221; is okay; &#8220;I wrote and it took N microseconds&#8221; is better; and &#8220;I wrote N bytes and it consumed M microseconds&#8221; is best.  Made a temp table on disk?  Nice &#8212; how big was it?  Mine&#8217;s smaller than yours!</p>

<p>The final way that instrumentation is like sex: more is better, to an extent.  You can get too much, but how often has that happened to you?</p>

<p>Related posts:<ol><li><a href='http://www.xaprb.com/blog/2009/02/12/5-ways-to-make-hexadecimal-identifiers-perform-better-on-mysql/' rel='bookmark' title='Permanent Link: 5 ways to make hexadecimal identifiers perform better on MySQL'>5 ways to make hexadecimal identifiers perform better on MySQL</a></li><li><a href='http://www.xaprb.com/blog/2006/07/19/3-ways-to-maintain-rollup-tables-in-sql/' rel='bookmark' title='Permanent Link: 3 ways to maintain rollup tables in SQL'>3 ways to maintain rollup tables in SQL</a></li><li><a href='http://www.xaprb.com/blog/2006/06/17/3-ways-to-write-upsert-and-merge-queries-in-mysql/' rel='bookmark' title='Permanent Link: 3 ways to write UPSERT and MERGE queries in MySQL'>3 ways to write UPSERT and MERGE queries in MySQL</a></li><li><a href='http://www.xaprb.com/blog/2009/09/27/6-ways-to-stay-sane-while-working-from-home/' rel='bookmark' title='Permanent Link: 6 ways to stay sane while working from home'>6 ways to stay sane while working from home</a></li><li><a href='http://www.xaprb.com/blog/2010/03/28/the-need-for-tunability-and-measurability/' rel='bookmark' title='Permanent Link: The need for tunability and measurability'>The need for tunability and measurability</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/03/30/4-ways-that-instrumentation-is-like-sex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
