<?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>PlanetMysql.ru - информация о СУБД MySQL &#187; SQL</title>
	<atom:link href="http://planetmysql.ru/category/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetmysql.ru</link>
	<description>Блог о самой популярной СУБД MySQL</description>
	<lastBuildDate>Thu, 29 Jul 2010 23:40:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Speaking at MySQL Meetup in Northern Virginia</title>
		<link>http://www.xaprb.com/blog/2010/07/21/speaking-at-mysql-meetup-in-northern-virginia/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=speaking-at-mysql-meetup-in-northern-virginia</link>
		<comments>http://www.xaprb.com/blog/2010/07/21/speaking-at-mysql-meetup-in-northern-virginia/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 13:34:26 +0000</pubDate>
		<dc:creator>Baron Schwartz (xaprb)</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[meetup]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1965</guid>
		<description><![CDATA[The closest thing I know of to a &#8220;Northern Virginia MySQL Meetup&#8221; is the Sterling Database Data Solutions Group.  I got in touch with the organizer and we scheduled a meeting next Wednesday July 28th.  I&#8217;ll be presenting, and so will someone from Fusion-IO, a solid-state storage vendor.  This is on short notice, so tell your friends about it!  It would be great to grow a strong monthly meetup presence in this area.

Here&#8217;s the abstract I sent: &#8220;This talk covers best practices to help you get the most out of MySQL performance. It assumes you know a database well, though it need not
be MySQL. We&#8217;ll cover several angles of the topic. Configuration is
usually the first thing people ask about. Although it&#8217;s possible to
misconfigure MySQL and get bad performance, the configuration options
you need for good performance are few and rather simple. We&#8217;ll see how
to inspect MySQL&#8217;s performance and status, also a fairly simple subject.
Next is query tuning. There are a few surprises in MySQL due to its
simpler query execution engine than Oracle or SQL Server. We&#8217;ll see
how to avoid those surprises and work with the query optimizer.
Finally, we&#8217;ll focus on what you should know if you are considering
migrating part or all of your application from Oracle. There will be
plenty of time for questions, so bring yours!&#8221;

Related posts:I&#8217;ll be speaking at the O&#8217;Reilly MySQL Conference 2010Speaking at Surge 2010Speaking at EdUI Conference 2009Speaking at CPOSC 2009Speaking about Maatkit at CPOSC]]></description>
			<content:encoded><![CDATA[<p>The closest thing I know of to a &#8220;Northern Virginia MySQL Meetup&#8221; is the <a href="http://www.meetup.com/The-Sterling-dbuser-Meetup-Group/">Sterling Database Data Solutions Group</a>.  I got in touch with the organizer and <a href="http://www.meetup.com/The-Sterling-dbuser-Meetup-Group/calendar/13862820/">we scheduled a meeting next Wednesday July 28th</a>.  I&#8217;ll be presenting, and so will someone from Fusion-IO, a solid-state storage vendor.  This is on short notice, so tell your friends about it!  It would be great to grow a strong monthly meetup presence in this area.</p>

<p>Here&#8217;s the abstract I sent: &#8220;This talk covers best practices to help you get the most out of MySQL performance. It assumes you know a database well, though it need not
be MySQL. We&#8217;ll cover several angles of the topic. Configuration is
usually the first thing people ask about. Although it&#8217;s possible to
misconfigure MySQL and get bad performance, the configuration options
you need for good performance are few and rather simple. We&#8217;ll see how
to inspect MySQL&#8217;s performance and status, also a fairly simple subject.
Next is query tuning. There are a few surprises in MySQL due to its
simpler query execution engine than Oracle or SQL Server. We&#8217;ll see
how to avoid those surprises and work with the query optimizer.
Finally, we&#8217;ll focus on what you should know if you are considering
migrating part or all of your application from Oracle. There will be
plenty of time for questions, so bring yours!&#8221;</p>

<p>Related posts:<ol><li><a href="http://www.xaprb.com/blog/2010/02/20/ill-be-speaking-at-the-oreilly-mysql-conference-2010/" rel="bookmark" title="Permanent Link: I’ll be speaking at the O’Reilly MySQL Conference 2010">I&#8217;ll be speaking at the O&#8217;Reilly MySQL Conference 2010</a></li><li><a href="http://www.xaprb.com/blog/2010/07/19/speaking-at-surge-2010/" rel="bookmark" title="Permanent Link: Speaking at Surge 2010">Speaking at Surge 2010</a></li><li><a href="http://www.xaprb.com/blog/2009/08/13/speaking-at-edui-conference-2009/" rel="bookmark" title="Permanent Link: Speaking at EdUI Conference 2009">Speaking at EdUI Conference 2009</a></li><li><a href="http://www.xaprb.com/blog/2009/10/05/speaking-at-cposc-2009/" rel="bookmark" title="Permanent Link: Speaking at CPOSC 2009">Speaking at CPOSC 2009</a></li><li><a href="http://www.xaprb.com/blog/2009/08/29/speaking-about-maatkit-at-cposc/" rel="bookmark" title="Permanent Link: Speaking about Maatkit at CPOSC">Speaking about Maatkit at CPOSC</a></li></ol></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25352&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25352&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/21/speaking-at-mysql-meetup-in-northern-virginia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL trick: overcoming GROUP_CONCAT limitation in special cases</title>
		<link>http://code.openark.org/blog/mysql/sql-trick-overcoming-group_concat-limitation-in-special-cases?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sql-trick-overcoming-group_concat-limitation-in-special-cases</link>
		<comments>http://code.openark.org/blog/mysql/sql-trick-overcoming-group_concat-limitation-in-special-cases#comments</comments>
		<pubDate>Wed, 21 Jul 2010 13:14:30 +0000</pubDate>
		<dc:creator>Shlomi Noach</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://code.openark.org/blog/?p=2580</guid>
		<description><![CDATA[In Verifying GROUP_CONCAT limit without using variables, I have presented a test to verify if group_concat_max_len is sufficient for known limitations. I will follow the path where I assume I cannot control group_concat_max_len, not even in session scope, and show an SQL solution, dirty as it is, to overcome the GROUP_CONCAT limitation, under certain conditions.
Sheeri rightfully asks why I wouldn&#8217;t just set group_concat_max_len in session scope. The particular case I have is that I&#8217;m providing a VIEW definition. I&#8217;d like users to &#8220;install&#8221; that view, i.e. to CREATE it on their database. The VIEW does some logic, and uses GROUP_CONCAT to implement that logic.
Now, I have no control on the DBA or developer who created the view. The creation of the view has nothing to do with the group_concat_max_len setting on her database instance.
An example
OK, apologies aside. Using the sakila database, I execute:

mysql&#62; SELECT GROUP_CONCAT(last_name) FROM actor \G
*************************** 1. row ***************************
GROUP_CONCAT(last_name): AKROYD,AKROYD,AKROYD,ALLEN,ALLEN,ALLEN,ASTAIRE,BACALL,BAILEY,BAILEY,BALE,BALL,BARRYMORE,BASINGER,BENING,BENING,BERGEN,BERGMAN,BERRY,BERRY,BERRY,BIRCH,BLOOM,BOLGER,BOLGER,BRIDGES,BRODY,BRODY,BULLOCK,CAGE,CAGE,CARREY,CHAPLIN,CHASE,CHASE,CLOSE,COSTNER,CRAWFORD,CRAWFORD,CRONYN,CRONYN,CROWE,CRUISE,CRUZ,DAMON,DAVIS,DAVIS,DAVIS,DAY-LEWIS,DEAN,DEAN,DEE,DEE,DEGENERES,DEGENERES,DEGENERES,DENCH,DENCH,DEPP,DEPP,DERN,DREYFUSS,DUKAKIS,DUKAKIS,DUNST,FAWCETT,FAWCETT,GABLE,GARLAND,GARLAND,GARLAND,GIBSON,GOLDBERG,GOODING,GOODING,GRANT,GUINESS,GUINESS,GUINESS,HACKMAN,HACKMAN,HARRIS,HARRIS,HARRIS,HAWKE,HESTON,HOFFMAN,HOFFMAN,HOFFMAN,HOPE,HOPKINS,HOPKINS,HOPKINS,HOPPER,HOPPER,HUDSON,HUNT,HURT,JACKMAN,JACKMAN,JOHANSSON,JOHANSSON,JOHANSSON,JOLIE,JOVOVICH,KEITEL,KEITEL,KEITEL,KILMER,KILMER,KILMER,KILMER,KILMER,LEIGH,LOLLOBRIGIDA,MALDEN,MANSFIELD,MARX,MCCONAUGHEY,MCCONAUGHEY,MCDORMAND,MCKELLEN,MCKELLEN,MCQUEEN,MCQUEEN,MIRANDA,MONROE,MONROE,MOSTEL,MOSTEL,NEESON,NEESON,NICHOLSON,NOLTE,NOLTE,NOLTE,NOLTE,OLIVIER,OLIVIER,PALTROW,PALTROW,P
1 row in set, 1 warning (0.00 sec)

mysql&#62; SHOW WARNINGS;
+---------+------+--------------------------------------+
&#124; Level   &#124; Code &#124; Message                              &#124;
+---------+------+--------------------------------------+
&#124; Warning &#124; 1260 &#124; 1 line(s) were cut by GROUP_CONCAT() &#124;
+---------+------+--------------------------------------+
1 row in set (0.00 sec)


So, my GROUP_CONCAT has been truncated. How much did I lose?

mysql&#62; SELECT SUM(LENGTH(last_name) + 1) - 1 FROM actor;
+--------------------------------+
&#124; SUM(LENGTH(last_name) + 1) - 1 &#124;
+--------------------------------+
&#124;                           1445 &#124;
+--------------------------------+


(In the above query I counted the separating commas; they are part of the GROUP_CONCAT limit).
The special case at hand
The proposed SQL trick assumes the following:

The length of the GROUP_CONCAT result is known to be under a certain value.
A GROUP_CONCAT of any set of n rows is known to be shorter than (or equal to) 1024 characters.

In our above example, I happen to know that the length of the GROUP_CONCAT result is below 2048. I also happen to know that any 100 rows will yield in a GROUP_CONCAT length of less than 1024.
How can I know this? Well, the length of my VARCHAR, or the fact I&#8217;m handling INT values can give me upper bounds on total lengths.
Steps towards the solution
Returning to our example, my intention becomes clearer: I want to work it out in two phases (later on I&#8217;ll show how this can be done in more phases). Any of the following is good:

mysql&#62; SELECT GROUP_CONCAT(last_name) FROM actor WHERE actor_id BETWEEN 1 and 100 \G
*************************** 1. row ***************************
GROUP_CONCAT(last_name): GUINESS,WAHLBERG,CHASE,DAVIS,LOLLOBRIGIDA,NICHOLSON,MOSTEL,JOHANSSON,SWANK,GABLE,CAGE,BERRY,WOOD,BERGEN,OLIVIER,COSTNER,VOIGHT,TORN,FAWCETT,TRACY,PALTROW,MARX,KILMER,STREEP,BLOOM,CRAWFORD,MCQUEEN,HOFFMAN,WAYNE,PECK,SOBIESKI,HACKMAN,PECK,OLIVIER,DEAN,DUKAKIS,BOLGER,MCKELLEN,BRODY,CAGE,DEGENERES,MIRANDA,JOVOVICH,STALLONE,KILMER,GOLDBERG,BARRYMORE,DAY-LEWIS,CRONYN,HOPKINS,PHOENIX,HUNT,TEMPLE,PINKETT,KILMER,HARRIS,CRUISE,AKROYD,TAUTOU,BERRY,NEESON,NEESON,WRAY,JOHANSSON,HUDSON,TANDY,BAILEY,WINSLET,PALTROW,MCCONAUGHEY,GRANT,WILLIAMS,PENN,KEITEL,POSEY,ASTAIRE,MCCONAUGHEY,SINATRA,HOFFMAN,CRUZ,DAMON,JOLIE,WILLIS,PITT,ZELLWEGER,CHAPLIN,PECK,PESCI,DENCH,GUINESS,BERRY,AKROYD,PRESLEY,TORN,WAHLBERG,WILLIS,HAWKE,BRIDGES,MOSTEL,DEPP
1 row in set (0.00 sec)

mysql&#62; SELECT GROUP_CONCAT(last_name) FROM actor WHERE actor_id BETWEEN 101 and 200 \G
*************************** 1. row ***************************
GROUP_CONCAT(last_name): DAVIS,TORN,LEIGH,CRONYN,CROWE,DUNST,DEGENERES,NOLTE,DERN,DAVIS,ZELLWEGER,BACALL,HOPKINS,MCDORMAND,BALE,STREEP,TRACY,ALLEN,JACKMAN,MONROE,BERGMAN,NOLTE,DENCH,BENING,NOLTE,TOMEI,GARLAND,MCQUEEN,CRAWFORD,KEITEL,JACKMAN,HOPPER,PENN,HOPKINS,REYNOLDS,MANSFIELD,WILLIAMS,DEE,GOODING,HURT,HARRIS,RYDER,DEAN,WITHERSPOON,ALLEN,JOHANSSON,WINSLET,DEE,TEMPLE,NOLTE,HESTON,HARRIS,KILMER,GIBSON,TANDY,WOOD,MALDEN,BASINGER,BRODY,DEPP,HOPE,KILMER,WEST,WILLIS,GARLAND,DEGENERES,BULLOCK,WILSON,HOFFMAN,HOPPER,PFEIFFER,WILLIAMS,DREYFUSS,BENING,HACKMAN,CHASE,MCKELLEN,MONROE,GUINESS,SILVERSTONE,CARREY,AKROYD,CLOSE,GARLAND,BOLGER,ZELLWEGER,BALL,DUKAKIS,BIRCH,BAILEY,GOODING,SUVARI,TEMPLE,ALLEN,SILVERSTONE,WALKEN,WEST,KEITEL,FAWCETT,TEMPLE
1 row in set (0.00 sec)


It&#8217;s somewhat tempting to try the following trick based on IF, but see what happens:

mysql&#62; SELECT GROUP_CONCAT(IF(actor_id BETWEEN 1 AND 100, last_name, '')) FROM actor\G
*************************** 1. row ***************************
GROUP_CONCAT(IF(actor_id BETWEEN 1 AND 100, last_name, '')): AKROYD,AKROYD,,,,,ASTAIRE,,BAILEY,,,,BARRYMORE,,,,BERGEN,,BERRY,BERRY,BERRY,,BLOOM,BOLGER,,BRIDGES,BRODY,,,CAGE,CAGE,,CHAPLIN,CHASE,,,COSTNER,CRAWFORD,,CRONYN,,,CRUISE,CRUZ,DAMON,DAVIS,,,DAY-LEWIS,DEAN,,,,DEGENERES,,,DENCH,,DEPP,,,,DUKAKIS,,,FAWCETT,,GABLE,,,,,GOLDBERG,,,GRANT,GUINESS,GUINESS,,HACKMAN,,HARRIS,,,HAWKE,,HOFFMAN,HOFFMAN,,,HOPKINS,,,,,HUDSON,HUNT,,,,JOHANSSON,JOHANSSON,,JOLIE,JOVOVICH,KEITEL,,,KILMER,KILMER,KILMER,,,,LOLLOBRIGIDA,,,MARX,MCCONAUGHEY,MCCONAUGHEY,,MCKELLEN,,MCQUEEN,,MIRANDA,,,MOSTEL,MOSTEL,NEESON,NEESON,NICHOLSON,,,,,OLIVIER,OLIVIER,PALTROW,PALTROW,PECK,PECK,PECK,PENN,,PESCI,,PHOENIX,PINKETT,PITT,POSEY,PRESLEY,,,,,SINATRA,SOBIESKI,STALLONE,STREEP,,,SWANK,TANDY,,TAUTOU,TEMPLE,,,,,TORN,TORN,,TRACY,,VOIGHT,WAHLBERG,WAHLBERG,,WAYNE,,,WILLIAMS,,,WILLIS,WILLIS,,,WINSLET,,,WOOD,,WRAY,ZELLWEGER,,
1 row in set (0.00 sec)


We&#8217;re getting there, though. We will mimic GROUP_CONCAT&#8216;s separator by using CONCAT, and remove the default separator:

SELECT
 GROUP_CONCAT(
   IF(actor_id BETWEEN 1 AND 100, CONCAT(',', last_name), '')
   SEPARATOR ''
 ) AS result
FROM actor
\G
*************************** 1. row ***************************
result: ,AKROYD,AKROYD,ASTAIRE,BAILEY,BARRYMORE,BERGEN,BERRY,BERRY,BERRY,BLOOM,BOLGER,BRIDGES,BRODY,CAGE,CAGE,CHAPLIN,CHASE,COSTNER,CRAWFORD,CRONYN,CRUISE,CRUZ,DAMON,DAVIS,DAY-LEWIS,DEAN,DEGENERES,DENCH,DEPP,DUKAKIS,FAWCETT,GABLE,GOLDBERG,GRANT,GUINESS,GUINESS,HACKMAN,HARRIS,HAWKE,HOFFMAN,HOFFMAN,HOPKINS,HUDSON,HUNT,JOHANSSON,JOHANSSON,JOLIE,JOVOVICH,KEITEL,KILMER,KILMER,KILMER,LOLLOBRIGIDA,MARX,MCCONAUGHEY,MCCONAUGHEY,MCKELLEN,MCQUEEN,MIRANDA,MOSTEL,MOSTEL,NEESON,NEESON,NICHOLSON,OLIVIER,OLIVIER,PALTROW,PALTROW,PECK,PECK,PECK,PENN,PESCI,PHOENIX,PINKETT,PITT,POSEY,PRESLEY,SINATRA,SOBIESKI,STALLONE,STREEP,SWANK,TANDY,TAUTOU,TEMPLE,TORN,TORN,TRACY,VOIGHT,WAHLBERG,WAHLBERG,WAYNE,WILLIAMS,WILLIS,WILLIS,WINSLET,WOOD,WRAY,ZELLWEGER
1 row in set (0.00 sec)


Solution
Let&#8217;s combine all we had so far to get the final result:

SELECT
  SUBSTRING(
    CONCAT(
      GROUP_CONCAT(
        IF(actor_id BETWEEN 1 AND 100, CONCAT(',', last_name), '')
        SEPARATOR ''
      ),
      GROUP_CONCAT(
        IF(actor_id BETWEEN 100 AND 200, CONCAT(',', last_name), '')
        SEPARATOR ''
      )
    ),
    2
  ) AS result
FROM actor
\G

*************************** 1. row ***************************
result: AKROYD,AKROYD,ASTAIRE,BAILEY,BARRYMORE,BERGEN,BERRY,BERRY,BERRY,BLOOM,BOLGER,BRIDGES,BRODY,CAGE,CAGE,CHAPLIN,CHASE,COSTNER,CRAWFORD,CRONYN,CRUISE,CRUZ,DAMON,DAVIS,DAY-LEWIS,DEAN,DEGENERES,DENCH,DEPP,DUKAKIS,FAWCETT,GABLE,GOLDBERG,GRANT,GUINESS,GUINESS,HACKMAN,HARRIS,HAWKE,HOFFMAN,HOFFMAN,HOPKINS,HUDSON,HUNT,JOHANSSON,JOHANSSON,JOLIE,JOVOVICH,KEITEL,KILMER,KILMER,KILMER,LOLLOBRIGIDA,MARX,MCCONAUGHEY,MCCONAUGHEY,MCKELLEN,MCQUEEN,MIRANDA,MOSTEL,MOSTEL,NEESON,NEESON,NICHOLSON,OLIVIER,OLIVIER,PALTROW,PALTROW,PECK,PECK,PECK,PENN,PESCI,PHOENIX,PINKETT,PITT,POSEY,PRESLEY,SINATRA,SOBIESKI,STALLONE,STREEP,SWANK,TANDY,TAUTOU,TEMPLE,TORN,TORN,TRACY,VOIGHT,WAHLBERG,WAHLBERG,WAYNE,WILLIAMS,WILLIS,WILLIS,WINSLET,WOOD,WRAY,ZELLWEGER,AKROYD,ALLEN,ALLEN,ALLEN,BACALL,BAILEY,BALE,BALL,BASINGER,BENING,BENING,BERGMAN,BIRCH,BOLGER,BRODY,BULLOCK,CARREY,CHASE,CLOSE,CRAWFORD,CRONYN,CROWE,DAVIS,DAVIS,DEAN,DEE,DEE,DEGENERES,DEGENERES,DENCH,DEPP,DEPP,DERN,DREYFUSS,DUKAKIS,DUNST,FAWCETT,GARLAND,GARLAND,GARLAND,GIBSON,GOODING,GOODING,GUINESS,HACKMAN,HARRIS,HARRIS,HESTON,HOFFMAN,HOPE,HOPKINS,HOPKINS,HOPPER,HOPPER,HURT,JACKMAN,JACKMAN,JOHANSSON,KEITEL,KEITEL,KILMER,KILMER,LEIGH,MALDEN,MANSFIELD,MCDORMAND,MCKELLEN,MCQUEEN,MONROE,MONROE,NOLTE,NOLTE,NOLTE,NOLTE,PENN,PFEIFFER,REYNOLDS,RYDER,SILVERSTONE,SILVERSTONE,STREEP,SUVARI,TANDY,TEMPLE,TEMPLE,TEMPLE,TOMEI,TORN,TRACY,WALKEN,WEST,WEST,WILLIAMS,WILLIAMS,WILLIS,WILSON,WINSLET,WITHERSPOON,WOOD,ZELLWEGER,ZELLWEGER
1 row in set (0.00 sec)


More than 2048 characters?
As far as the upper limit is known, we can work this trick in the same manner. Assume the length is expected to be 3000 characters. We can then CONCAT three, or four, or five GROUP_CONCAT results, each of fewer number of rows as required. Just copy+paste the above GROUP_CONCAT(&#8230;) clause a couple more times, and edit the actor_id BETWEEN n AND m clauses.
Moreover, further using MIN(actor_id), MAX(actor_id) can minimize dependencies on specific values.
Dirty? ugly? Not arguing. But it&#8217;s working! In some ways it is not such a dirty solution: I&#8217;m avoiding using stored routines (easily setting the group_concat_max_len session variable from within a stored function&#8217;s body, see Justin&#8217;s suggestion), so I&#8217;m only relying on SQL, not on &#8220;external&#8221; technology, if I may call it that way.]]></description>
			<content:encoded><![CDATA[<p>In <a title="Link to Verifying GROUP_CONCAT limit without  using variables" rel="bookmark" href="http://code.openark.org/blog/mysql/verifying-group_concat-limit-without-using-variables">Verifying GROUP_CONCAT limit without using variables</a>, I have presented a test to verify if <strong>group_concat_max_len</strong> is sufficient for known limitations. I will follow the path where I assume I cannot control <strong>group_concat_max_len</strong>, not even in session scope, and show an SQL solution, dirty as it is, to overcome the <strong>GROUP_CONCAT</strong> limitation, under certain conditions.</p>
<p>Sheeri rightfully <a href="http://code.openark.org/blog/mysql/verifying-group_concat-limit-without-using-variables#comment-14617">asks</a> why I wouldn&#8217;t just set <strong>group_concat_max_len </strong>in session scope. The particular case I have is that I&#8217;m providing a VIEW definition. I&#8217;d like users to &#8220;install&#8221; that view, i.e. to <strong>CREATE</strong> it on their database. The VIEW does some logic, and uses <strong>GROUP_CONCAT</strong> to implement that logic.</p>
<p>Now, I have no control on the DBA or developer who created the view. The creation of the view has nothing to do with the <strong>group_concat_max_len</strong> setting on her database instance.</p>
<h4>An example</h4>
<p>OK, apologies aside. Using the <a href="http://dev.mysql.com/doc/sakila/en/sakila.html">sakila</a> database, I execute:</p>
<blockquote>
<pre>mysql&gt; SELECT GROUP_CONCAT(last_name) FROM actor \G
*************************** 1. row ***************************
GROUP_CONCAT(last_name): AKROYD,AKROYD,AKROYD,ALLEN,ALLEN,ALLEN,ASTAIRE,BACALL,BAILEY,BAILEY,BALE,BALL,BARRYMORE,BASINGER,BENING,BENING,BERGEN,BERGMAN,BERRY,BERRY,BERRY,BIRCH,BLOOM,BOLGER,BOLGER,BRIDGES,BRODY,BRODY,BULLOCK,CAGE,CAGE,CARREY,CHAPLIN,CHASE,CHASE,CLOSE,COSTNER,CRAWFORD,CRAWFORD,CRONYN,CRONYN,CROWE,CRUISE,CRUZ,DAMON,DAVIS,DAVIS,DAVIS,DAY-LEWIS,DEAN,DEAN,DEE,DEE,DEGENERES,DEGENERES,DEGENERES,DENCH,DENCH,DEPP,DEPP,DERN,DREYFUSS,DUKAKIS,DUKAKIS,DUNST,FAWCETT,FAWCETT,GABLE,GARLAND,GARLAND,GARLAND,GIBSON,GOLDBERG,GOODING,GOODING,GRANT,GUINESS,GUINESS,GUINESS,HACKMAN,HACKMAN,HARRIS,HARRIS,HARRIS,HAWKE,HESTON,HOFFMAN,HOFFMAN,HOFFMAN,HOPE,HOPKINS,HOPKINS,HOPKINS,HOPPER,HOPPER,HUDSON,HUNT,HURT,JACKMAN,JACKMAN,JOHANSSON,JOHANSSON,JOHANSSON,JOLIE,JOVOVICH,KEITEL,KEITEL,KEITEL,KILMER,KILMER,KILMER,KILMER,KILMER,LEIGH,LOLLOBRIGIDA,MALDEN,MANSFIELD,MARX,MCCONAUGHEY,MCCONAUGHEY,MCDORMAND,MCKELLEN,MCKELLEN,MCQUEEN,MCQUEEN,MIRANDA,MONROE,MONROE,MOSTEL,MOSTEL,NEESON,NEESON,NICHOLSON,NOLTE,NOLTE,NOLTE,NOLTE,OLIVIER,OLIVIER,PALTROW,PALTROW,P
1 row in set, 1 warning (0.00 sec)

mysql&gt; SHOW WARNINGS;
+---------+------+--------------------------------------+
| Level   | Code | Message                              |
+---------+------+--------------------------------------+
| Warning | 1260 | 1 line(s) were cut by GROUP_CONCAT() |
+---------+------+--------------------------------------+
1 row in set (0.00 sec)
</pre>
</blockquote>
<p><span></span>So, my <strong>GROUP_CONCAT</strong> has been truncated. How much did I lose?</p>
<blockquote>
<pre>mysql&gt; SELECT SUM(LENGTH(last_name) + 1) - 1 FROM actor;
+--------------------------------+
| SUM(LENGTH(last_name) + 1) - 1 |
+--------------------------------+
|                           1445 |
+--------------------------------+
</pre>
</blockquote>
<p>(In the above query I counted the separating commas; they are part of the <strong>GROUP_CONCAT</strong> limit).</p>
<h4>The special case at hand</h4>
<p>The proposed SQL trick assumes the following:</p>
<ul>
<li>The length of the <strong>GROUP_CONCAT</strong> result is <em>known to be under a certain value</em>.</li>
<li>A <strong>GROUP_CONCAT</strong> of any set of <em>n</em> rows is <em>known to be shorter than (or equal to) <strong>1024</strong> characters</em>.</li>
</ul>
<p>In our above example, I happen to know that the length of the <strong>GROUP_CONCAT</strong> result is below <strong>2048</strong>. I also happen to know that any <strong>100</strong> rows will yield in a <strong>GROUP_CONCAT</strong> length of less than <strong>1024</strong>.</p>
<p>How can I know this? Well, the length of my <strong>VARCHAR</strong>, or the fact I&#8217;m handling <strong>INT</strong> values can give me upper bounds on total lengths.</p>
<h4>Steps towards the solution</h4>
<p>Returning to our example, my intention becomes clearer: I want to work it out in two phases (later on I&#8217;ll show how this can be done in more phases). Any of the following is good:</p>
<blockquote>
<pre>mysql&gt; SELECT GROUP_CONCAT(last_name) FROM actor WHERE actor_id BETWEEN 1 and 100 \G
*************************** 1. row ***************************
GROUP_CONCAT(last_name): GUINESS,WAHLBERG,CHASE,DAVIS,LOLLOBRIGIDA,NICHOLSON,MOSTEL,JOHANSSON,SWANK,GABLE,CAGE,BERRY,WOOD,BERGEN,OLIVIER,COSTNER,VOIGHT,TORN,FAWCETT,TRACY,PALTROW,MARX,KILMER,STREEP,BLOOM,CRAWFORD,MCQUEEN,HOFFMAN,WAYNE,PECK,SOBIESKI,HACKMAN,PECK,OLIVIER,DEAN,DUKAKIS,BOLGER,MCKELLEN,BRODY,CAGE,DEGENERES,MIRANDA,JOVOVICH,STALLONE,KILMER,GOLDBERG,BARRYMORE,DAY-LEWIS,CRONYN,HOPKINS,PHOENIX,HUNT,TEMPLE,PINKETT,KILMER,HARRIS,CRUISE,AKROYD,TAUTOU,BERRY,NEESON,NEESON,WRAY,JOHANSSON,HUDSON,TANDY,BAILEY,WINSLET,PALTROW,MCCONAUGHEY,GRANT,WILLIAMS,PENN,KEITEL,POSEY,ASTAIRE,MCCONAUGHEY,SINATRA,HOFFMAN,CRUZ,DAMON,JOLIE,WILLIS,PITT,ZELLWEGER,CHAPLIN,PECK,PESCI,DENCH,GUINESS,BERRY,AKROYD,PRESLEY,TORN,WAHLBERG,WILLIS,HAWKE,BRIDGES,MOSTEL,DEPP
1 row in set (0.00 sec)

mysql&gt; SELECT GROUP_CONCAT(last_name) FROM actor WHERE actor_id BETWEEN 101 and 200 \G
*************************** 1. row ***************************
GROUP_CONCAT(last_name): DAVIS,TORN,LEIGH,CRONYN,CROWE,DUNST,DEGENERES,NOLTE,DERN,DAVIS,ZELLWEGER,BACALL,HOPKINS,MCDORMAND,BALE,STREEP,TRACY,ALLEN,JACKMAN,MONROE,BERGMAN,NOLTE,DENCH,BENING,NOLTE,TOMEI,GARLAND,MCQUEEN,CRAWFORD,KEITEL,JACKMAN,HOPPER,PENN,HOPKINS,REYNOLDS,MANSFIELD,WILLIAMS,DEE,GOODING,HURT,HARRIS,RYDER,DEAN,WITHERSPOON,ALLEN,JOHANSSON,WINSLET,DEE,TEMPLE,NOLTE,HESTON,HARRIS,KILMER,GIBSON,TANDY,WOOD,MALDEN,BASINGER,BRODY,DEPP,HOPE,KILMER,WEST,WILLIS,GARLAND,DEGENERES,BULLOCK,WILSON,HOFFMAN,HOPPER,PFEIFFER,WILLIAMS,DREYFUSS,BENING,HACKMAN,CHASE,MCKELLEN,MONROE,GUINESS,SILVERSTONE,CARREY,AKROYD,CLOSE,GARLAND,BOLGER,ZELLWEGER,BALL,DUKAKIS,BIRCH,BAILEY,GOODING,SUVARI,TEMPLE,ALLEN,SILVERSTONE,WALKEN,WEST,KEITEL,FAWCETT,TEMPLE
1 row in set (0.00 sec)
</pre>
</blockquote>
<p>It&#8217;s somewhat tempting to try the following trick based on <strong>IF</strong>, but see what happens:</p>
<blockquote>
<pre>mysql&gt; SELECT GROUP_CONCAT(IF(actor_id BETWEEN 1 AND 100, last_name, '')) FROM actor\G
*************************** 1. row ***************************
GROUP_CONCAT(IF(actor_id BETWEEN 1 AND 100, last_name, '')): AKROYD,AKROYD,,,,,ASTAIRE,,BAILEY,,,,BARRYMORE,,,,BERGEN,,BERRY,BERRY,BERRY,,BLOOM,BOLGER,,BRIDGES,BRODY,,,CAGE,CAGE,,CHAPLIN,CHASE,,,COSTNER,CRAWFORD,,CRONYN,,,CRUISE,CRUZ,DAMON,DAVIS,,,DAY-LEWIS,DEAN,,,,DEGENERES,,,DENCH,,DEPP,,,,DUKAKIS,,,FAWCETT,,GABLE,,,,,GOLDBERG,,,GRANT,GUINESS,GUINESS,,HACKMAN,,HARRIS,,,HAWKE,,HOFFMAN,HOFFMAN,,,HOPKINS,,,,,HUDSON,HUNT,,,,JOHANSSON,JOHANSSON,,JOLIE,JOVOVICH,KEITEL,,,KILMER,KILMER,KILMER,,,,LOLLOBRIGIDA,,,MARX,MCCONAUGHEY,MCCONAUGHEY,,MCKELLEN,,MCQUEEN,,MIRANDA,,,MOSTEL,MOSTEL,NEESON,NEESON,NICHOLSON,,,,,OLIVIER,OLIVIER,PALTROW,PALTROW,PECK,PECK,PECK,PENN,,PESCI,,PHOENIX,PINKETT,PITT,POSEY,PRESLEY,,,,,SINATRA,SOBIESKI,STALLONE,STREEP,,,SWANK,TANDY,,TAUTOU,TEMPLE,,,,,TORN,TORN,,TRACY,,VOIGHT,WAHLBERG,WAHLBERG,,WAYNE,,,WILLIAMS,,,WILLIS,WILLIS,,,WINSLET,,,WOOD,,WRAY,ZELLWEGER,,
1 row in set (0.00 sec)
</pre>
</blockquote>
<p>We&#8217;re getting there, though. We will mimic <strong>GROUP_CONCAT</strong>&#8216;s separator by using <strong>CONCAT</strong>, and remove the default separator:</p>
<blockquote>
<pre>SELECT
 GROUP_CONCAT(
   IF(actor_id BETWEEN 1 AND 100, CONCAT(',', last_name), '')
   SEPARATOR ''
 ) AS result
FROM actor
\G
*************************** 1. row ***************************
result: ,AKROYD,AKROYD,ASTAIRE,BAILEY,BARRYMORE,BERGEN,BERRY,BERRY,BERRY,BLOOM,BOLGER,BRIDGES,BRODY,CAGE,CAGE,CHAPLIN,CHASE,COSTNER,CRAWFORD,CRONYN,CRUISE,CRUZ,DAMON,DAVIS,DAY-LEWIS,DEAN,DEGENERES,DENCH,DEPP,DUKAKIS,FAWCETT,GABLE,GOLDBERG,GRANT,GUINESS,GUINESS,HACKMAN,HARRIS,HAWKE,HOFFMAN,HOFFMAN,HOPKINS,HUDSON,HUNT,JOHANSSON,JOHANSSON,JOLIE,JOVOVICH,KEITEL,KILMER,KILMER,KILMER,LOLLOBRIGIDA,MARX,MCCONAUGHEY,MCCONAUGHEY,MCKELLEN,MCQUEEN,MIRANDA,MOSTEL,MOSTEL,NEESON,NEESON,NICHOLSON,OLIVIER,OLIVIER,PALTROW,PALTROW,PECK,PECK,PECK,PENN,PESCI,PHOENIX,PINKETT,PITT,POSEY,PRESLEY,SINATRA,SOBIESKI,STALLONE,STREEP,SWANK,TANDY,TAUTOU,TEMPLE,TORN,TORN,TRACY,VOIGHT,WAHLBERG,WAHLBERG,WAYNE,WILLIAMS,WILLIS,WILLIS,WINSLET,WOOD,WRAY,ZELLWEGER
1 row in set (0.00 sec)
</pre>
</blockquote>
<h4>Solution</h4>
<p>Let&#8217;s combine all we had so far to get the final result:</p>
<blockquote>
<pre>SELECT
  SUBSTRING(
    CONCAT(
      GROUP_CONCAT(
        IF(actor_id BETWEEN 1 AND 100, CONCAT(',', last_name), '')
        SEPARATOR ''
      ),
      GROUP_CONCAT(
        IF(actor_id BETWEEN 100 AND 200, CONCAT(',', last_name), '')
        SEPARATOR ''
      )
    ),
    2
  ) AS result
FROM actor
\G

*************************** 1. row ***************************
result: AKROYD,AKROYD,ASTAIRE,BAILEY,BARRYMORE,BERGEN,BERRY,BERRY,BERRY,BLOOM,BOLGER,BRIDGES,BRODY,CAGE,CAGE,CHAPLIN,CHASE,COSTNER,CRAWFORD,CRONYN,CRUISE,CRUZ,DAMON,DAVIS,DAY-LEWIS,DEAN,DEGENERES,DENCH,DEPP,DUKAKIS,FAWCETT,GABLE,GOLDBERG,GRANT,GUINESS,GUINESS,HACKMAN,HARRIS,HAWKE,HOFFMAN,HOFFMAN,HOPKINS,HUDSON,HUNT,JOHANSSON,JOHANSSON,JOLIE,JOVOVICH,KEITEL,KILMER,KILMER,KILMER,LOLLOBRIGIDA,MARX,MCCONAUGHEY,MCCONAUGHEY,MCKELLEN,MCQUEEN,MIRANDA,MOSTEL,MOSTEL,NEESON,NEESON,NICHOLSON,OLIVIER,OLIVIER,PALTROW,PALTROW,PECK,PECK,PECK,PENN,PESCI,PHOENIX,PINKETT,PITT,POSEY,PRESLEY,SINATRA,SOBIESKI,STALLONE,STREEP,SWANK,TANDY,TAUTOU,TEMPLE,TORN,TORN,TRACY,VOIGHT,WAHLBERG,WAHLBERG,WAYNE,WILLIAMS,WILLIS,WILLIS,WINSLET,WOOD,WRAY,ZELLWEGER,AKROYD,ALLEN,ALLEN,ALLEN,BACALL,BAILEY,BALE,BALL,BASINGER,BENING,BENING,BERGMAN,BIRCH,BOLGER,BRODY,BULLOCK,CARREY,CHASE,CLOSE,CRAWFORD,CRONYN,CROWE,DAVIS,DAVIS,DEAN,DEE,DEE,DEGENERES,DEGENERES,DENCH,DEPP,DEPP,DERN,DREYFUSS,DUKAKIS,DUNST,FAWCETT,GARLAND,GARLAND,GARLAND,GIBSON,GOODING,GOODING,GUINESS,HACKMAN,HARRIS,HARRIS,HESTON,HOFFMAN,HOPE,HOPKINS,HOPKINS,HOPPER,HOPPER,HURT,JACKMAN,JACKMAN,JOHANSSON,KEITEL,KEITEL,KILMER,KILMER,LEIGH,MALDEN,MANSFIELD,MCDORMAND,MCKELLEN,MCQUEEN,MONROE,MONROE,NOLTE,NOLTE,NOLTE,NOLTE,PENN,PFEIFFER,REYNOLDS,RYDER,SILVERSTONE,SILVERSTONE,STREEP,SUVARI,TANDY,TEMPLE,TEMPLE,TEMPLE,TOMEI,TORN,TRACY,WALKEN,WEST,WEST,WILLIAMS,WILLIAMS,WILLIS,WILSON,WINSLET,WITHERSPOON,WOOD,ZELLWEGER,ZELLWEGER
1 row in set (0.00 sec)
</pre>
</blockquote>
<h4>More than 2048 characters?</h4>
<p>As far as the upper limit is known, we can work this trick in the same manner. Assume the length is expected to be <strong>3000</strong> characters. We can then <strong>CONCAT</strong> three, or four, or five <strong>GROUP_CONCAT</strong> results, each of fewer number of rows as required. Just copy+paste the above <strong>GROUP_CONCAT(&#8230;)</strong> clause a couple more times, and edit the <strong>actor_id BETWEEN n AND m</strong> clauses.</p>
<p>Moreover, further using <strong>MIN(actor_id)</strong>, <strong>MAX(actor_id)</strong> can minimize dependencies on specific values.</p>
<p>Dirty? ugly? Not arguing. But it&#8217;s working! In some ways it is not such a dirty solution: I&#8217;m avoiding using stored routines (easily setting the <strong>group_concat_max_len</strong> session variable from within a stored function&#8217;s body, see Justin&#8217;s <a href="http://code.openark.org/blog/mysql/verifying-group_concat-limit-without-using-variables#comment-14641">suggestion</a>), so I&#8217;m only relying on SQL, not on &#8220;external&#8221; technology, if I may call it that way.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25351&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25351&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://code.openark.org/blog/mysql/sql-trick-overcoming-group_concat-limitation-in-special-cases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at Surge 2010</title>
		<link>http://www.xaprb.com/blog/2010/07/19/speaking-at-surge-2010/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=speaking-at-surge-2010</link>
		<comments>http://www.xaprb.com/blog/2010/07/19/speaking-at-surge-2010/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 15:47:47 +0000</pubDate>
		<dc:creator>Baron Schwartz (xaprb)</dc:creator>
				<category><![CDATA[Neil J. Gunther]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[conferences]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1959</guid>
		<description><![CDATA[ OmniTI&#8217;s Surge conference is looking really good &#8212; and I&#8217;m going to be speaking there.  The CfP just closed, so the list of speakers is still growing, but it already includes impressive names such as Neil J. Gunther.  So far, this speaker list has zero fluff, and reminds me of the Percona Performance Conference.  I&#8217;ll be talking about how not to shard your systems.  Sharding is no fun and it&#8217;s costly.  If you don&#8217;t have to do it &#8212; and many applications don&#8217;t need to, with orders-of-magnitude performance improvements in MySQL &#8212; you should not.

Related posts:I&#8217;ll be speaking at the O&#8217;Reilly MySQL Conference 2010Speaking at EdUI Conference 2009Speaking about Maatkit at CPOSCVideos and slides for MySQL Conference 2010Speaking at CPOSC 2009]]></description>
			<content:encoded><![CDATA[<p><a href="http://omniti.com/surge"><img src="http://www.xaprb.com/blog/wp-content/uploads/2010/07/surge.png" alt="" title="Surge" width="188" height="90" class="alignleft size-full wp-image-1960" style="float:left; margin: 15px" /></a> OmniTI&#8217;s Surge conference is looking really good &#8212; and <a href="http://omniti.com/surge/2010/speakers/baron-schwartz">I&#8217;m going to be speaking there</a>.  The CfP just closed, so the list of speakers is still growing, but it already includes impressive names such as Neil J. Gunther.  So far, this speaker list has zero fluff, and reminds me of the <a href="http://conferences.percona.com/percona-performance-conference-2009/schedule.html">Percona Performance Conference</a>.  I&#8217;ll be talking about how not to shard your systems.  Sharding is no fun and it&#8217;s costly.  If you don&#8217;t have to do it &#8212; and many applications don&#8217;t need to, with orders-of-magnitude performance improvements in MySQL &#8212; you should not.</p>

<p>Related posts:<ol><li><a href="http://www.xaprb.com/blog/2010/02/20/ill-be-speaking-at-the-oreilly-mysql-conference-2010/" rel="bookmark" title="Permanent Link: I’ll be speaking at the O’Reilly MySQL Conference 2010">I&#8217;ll be speaking at the O&#8217;Reilly MySQL Conference 2010</a></li><li><a href="http://www.xaprb.com/blog/2009/08/13/speaking-at-edui-conference-2009/" rel="bookmark" title="Permanent Link: Speaking at EdUI Conference 2009">Speaking at EdUI Conference 2009</a></li><li><a href="http://www.xaprb.com/blog/2009/08/29/speaking-about-maatkit-at-cposc/" rel="bookmark" title="Permanent Link: Speaking about Maatkit at CPOSC">Speaking about Maatkit at CPOSC</a></li><li><a href="http://www.xaprb.com/blog/2010/04/24/videos-and-slides-for-mysql-conference-2010/" rel="bookmark" title="Permanent Link: Videos and slides for MySQL Conference 2010">Videos and slides for MySQL Conference 2010</a></li><li><a href="http://www.xaprb.com/blog/2009/10/05/speaking-at-cposc-2009/" rel="bookmark" title="Permanent Link: Speaking at CPOSC 2009">Speaking at CPOSC 2009</a></li></ol></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25330&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25330&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/19/speaking-at-surge-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aspersa’s mysql-summary tool</title>
		<link>http://www.xaprb.com/blog/2010/07/10/aspersas-mysql-summary-tool/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=aspersa%25e2%2580%2599s-mysql-summary-tool</link>
		<comments>http://www.xaprb.com/blog/2010/07/10/aspersas-mysql-summary-tool/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 19:46:25 +0000</pubDate>
		<dc:creator>Baron Schwartz (xaprb)</dc:creator>
				<category><![CDATA[Aspersa]]></category>
		<category><![CDATA[Maatkit]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1956</guid>
		<description><![CDATA[For those of you who miss what Maatkit&#8217;s mk-audit tool (now retired) gave you, there&#8217;s a pair of tools in Aspersa that more than replaces it.  I wrote previously about the summary tool.  I don&#8217;t think I have mentioned the mysql-summary tool.  It has been under development for a while, and at this point it has quite a lot of functionality.  You can see a sample of the output on its wiki page.

Related posts:Apsersa&#8217;s summary tool supports Adaptec and MegaRAID controllersAspersa, a new opensource toolkitUsing Aspersa to capture diagnostic dataMySQL Toolkit&#8217;s Show Grants tool 0.9.1 releasedIntroducing MySQL Toolkit&#8217;s Show Grants tool]]></description>
			<content:encoded><![CDATA[<p>For those of you who miss what <a href="http://www.maatkit.org/">Maatkit</a>&#8217;s mk-audit tool (now retired) gave you, there&#8217;s a pair of tools in <a href="http://code.google.com/p/aspersa/">Aspersa</a> that more than replaces it.  <a href="http://www.xaprb.com/blog/2010/05/16/apsersas-summary-tool-supports-adaptec-and-megaraid-controllers/">I wrote previously about the summary tool</a>.  I don&#8217;t think I have mentioned the mysql-summary tool.  It has been under development for a while, and at this point it has quite a lot of functionality.  You can see a <a href="http://code.google.com/p/aspersa/wiki/mysql_summary">sample of the output on its wiki page</a>.</p>

<p>Related posts:<ol><li><a href="http://www.xaprb.com/blog/2010/05/16/apsersas-summary-tool-supports-adaptec-and-megaraid-controllers/" rel="bookmark" title="Permanent Link: Apsersa’s summary tool supports Adaptec and MegaRAID controllers">Apsersa&#8217;s summary tool supports Adaptec and MegaRAID controllers</a></li><li><a href="http://www.xaprb.com/blog/2010/04/21/aspersa-a-new-opensource-toolkit/" rel="bookmark" title="Permanent Link: Aspersa, a new opensource toolkit">Aspersa, a new opensource toolkit</a></li><li><a href="http://www.xaprb.com/blog/2010/05/07/using-aspersa-to-capture-diagnostic-data/" rel="bookmark" title="Permanent Link: Using Aspersa to capture diagnostic data">Using Aspersa to capture diagnostic data</a></li><li><a href="http://www.xaprb.com/blog/2007/03/19/mysql-toolkits-show-grants-tool-091-released/" rel="bookmark" title="Permanent Link: MySQL Toolkit’s Show Grants tool 0.9.1 released">MySQL Toolkit&#8217;s Show Grants tool 0.9.1 released</a></li><li><a href="http://www.xaprb.com/blog/2007/03/17/introducing-mysql-show-grants/" rel="bookmark" title="Permanent Link: Introducing MySQL Toolkit’s Show Grants tool">Introducing MySQL Toolkit&#8217;s Show Grants tool</a></li></ol></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25269&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25269&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/10/aspersas-mysql-summary-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implicit casting you don’t want to see around</title>
		<link>http://code.openark.org/blog/mysql/implicit-casting-you-dont-want-to-see-around?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=implicit-casting-you-don%25e2%2580%2599t-want-to-see-around</link>
		<comments>http://code.openark.org/blog/mysql/implicit-casting-you-dont-want-to-see-around#comments</comments>
		<pubDate>Wed, 07 Jul 2010 08:53:37 +0000</pubDate>
		<dc:creator>Shlomi Noach</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[data-types]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://code.openark.org/blog/?p=2344</guid>
		<description><![CDATA[In Beware of implicit casting, I have outlined the dangers of implicit casting. Here&#8217;s a few more real-world examples I have tackled:
Number-String comparisons
Much like in programming languages, implicit casting is made to numbers when at least one of the arguments is a number. Thus:

mysql&#62; SELECT 3 = '3.0';
+-----------+
&#124; 3 = '3.0' &#124;
+-----------+
&#124;         1 &#124;
+-----------+
1 row in set (0.00 sec)

mysql&#62; SELECT '3' = '3.0';
+-------------+
&#124; '3' = '3.0' &#124;
+-------------+
&#124;           0 &#124;
+-------------+


The second query consists of pure strings comparison. I t has no way to determine that number comparison should be made.
Direct DATE arithmetics
The first query seems to work, but is completely incorrect. The second explains why. The third is a total mess.

mysql&#62; SELECT DATE('2010-01-01')+3;
+----------------------+
&#124; DATE('2010-01-01')+3 &#124;
+----------------------+
&#124;             20100104 &#124;
+----------------------+
1 row in set (0.00 sec)

mysql&#62; SELECT DATE('2010-01-01')-3;
+----------------------+
&#124; DATE('2010-01-01')-3 &#124;
+----------------------+
&#124;             20100098 &#124;
+----------------------+
1 row in set (0.00 sec)

mysql&#62; SELECT '2010-01-01' - 3;
+------------------+
&#124; '2010-01-01' - 3 &#124;
+------------------+
&#124;             2007 &#124;
+------------------+
1 row in set, 1 warning (0.00 sec)


Number-String comparisons, big integers
Look at the following crazy comparisons:

mysql&#62; SELECT 1234 = '1234';
+---------------+
&#124; 1234 = '1234' &#124;
+---------------+
&#124;             1 &#124;
+---------------+

mysql&#62; SELECT 123456789012345678 = '123456789012345678';
+-------------------------------------------+
&#124; 123456789012345678 = '123456789012345678' &#124;
+-------------------------------------------+
&#124;                                         0 &#124;
+-------------------------------------------+

mysql&#62; SELECT 123456789012345678 = '123456789012345677';
+-------------------------------------------+
&#124; 123456789012345678 = '123456789012345677' &#124;
+-------------------------------------------+
&#124;                                         1 &#124;
+-------------------------------------------+


The amazing result of the last two comparisons may strike as odd. Actually, it may strike as a bug, and indeed when a customer approached me with this behavior I was at loss for words. But this is documented. The manual describes the cases for casting, then states: &#8220;&#8230; In all other cases, the arguments are compared as             floating-point (real) numbers. &#8230;&#8221;
Lessons learned:

Be careful when comparing strings with floating point values. Matching depends on how both are represented.
Avoid converting temporal types to strings when doing date manipulation.
Avoid direct math on temporal types.
Avoid casting BIGINTs represented by strings. Casting will turn out to use FLOATs and may be incorrect.

Last but not least:

Use the proper data types for your data&#8217;s representation. When dealing with numbers, use numbers. When dealing with temporal values, use temporal types.
]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://code.openark.org/blog/mysql/beware-of-implicit-casting">Beware of implicit casting</a>, I have outlined the dangers of implicit casting. Here&#8217;s a few more real-world examples I have tackled:</p>
<h4>Number-String comparisons</h4>
<p>Much like in programming languages, implicit casting is made to numbers when at least one of the arguments is a number. Thus:</p>
<blockquote><pre>
mysql&gt; SELECT 3 = '3.0';
+-----------+
| 3 = '3.0' |
+-----------+
|         1 |
+-----------+
1 row in set (0.00 sec)

mysql&gt; SELECT '3' = '3.0';
+-------------+
| '3' = '3.0' |
+-------------+
|           0 |
+-------------+
</pre>
</blockquote>
<p>The second query consists of pure strings comparison. I t has no way to determine that number comparison should be made.</p>
<h4>Direct DATE arithmetics</h4>
<p>The first query <em>seems</em> to work, but is completely incorrect. The second explains why. The third is a total mess.<span></span></p>
<blockquote><pre>
mysql&gt; SELECT DATE('2010-01-01')+3;
+----------------------+
| DATE('2010-01-01')+3 |
+----------------------+
|             20100104 |
+----------------------+
1 row in set (0.00 sec)

mysql&gt; SELECT DATE('2010-01-01')-3;
+----------------------+
| DATE('2010-01-01')-3 |
+----------------------+
|             20100098 |
+----------------------+
1 row in set (0.00 sec)

mysql&gt; SELECT '2010-01-01' - 3;
+------------------+
| '2010-01-01' - 3 |
+------------------+
|             2007 |
+------------------+
1 row in set, 1 warning (0.00 sec)
</pre>
</blockquote>
<h4>Number-String comparisons, big integers</h4>
<p>Look at the following crazy comparisons:</p>
<blockquote><pre>
mysql&gt; SELECT 1234 = '1234';
+---------------+
| 1234 = '1234' |
+---------------+
|             1 |
+---------------+

mysql&gt; SELECT 123456789012345678 = '123456789012345678';
+-------------------------------------------+
| 123456789012345678 = '123456789012345678' |
+-------------------------------------------+
|                                         0 |
+-------------------------------------------+

mysql&gt; SELECT 123456789012345678 = '123456789012345677';
+-------------------------------------------+
| 123456789012345678 = '123456789012345677' |
+-------------------------------------------+
|                                         1 |
+-------------------------------------------+
</pre>
</blockquote>
<p>The amazing result of the last two comparisons may strike as odd. Actually, it may strike as a bug, and indeed when a customer approached me with this behavior I was at loss for words. But this is <a href="http://dev.mysql.com/doc/refman/5.0/en/type-conversion.html">documented</a>. The manual describes the cases for casting, then states: &#8220;&#8230; In all other cases, the arguments are compared <em>as             floating-point (real) numbers</em>. &#8230;&#8221;</p>
<h4>Lessons learned:</h4>
<ul>
<li>Be careful when comparing strings with floating point values. Matching depends on how both are represented.</li>
<li>Avoid converting temporal types to strings when doing date manipulation.</li>
<li>Avoid direct math on temporal types.</li>
<li>Avoid casting <strong>BIGINT</strong>s represented by strings. Casting will turn out to use <strong>FLOAT</strong>s and may be incorrect.</li>
</ul>
<p>Last but not least:</p>
<ul>
<li>Use the proper data types for your data&#8217;s representation. When dealing with numbers, use numbers. When dealing with temporal values, use temporal types.</li>
</ul><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25228&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25228&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://code.openark.org/blog/mysql/implicit-casting-you-dont-want-to-see-around/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A review of Guerrilla Capacity Planning by Neil Gunther</title>
		<link>http://www.xaprb.com/blog/2010/07/06/a-review-of-guerrilla-capacity-planning-by-neil-gunther/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-review-of-guerrilla-capacity-planning-by-neil-gunther</link>
		<comments>http://www.xaprb.com/blog/2010/07/06/a-review-of-guerrilla-capacity-planning-by-neil-gunther/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 01:54:45 +0000</pubDate>
		<dc:creator>Baron Schwartz (xaprb)</dc:creator>
				<category><![CDATA[Cary Millsap]]></category>
		<category><![CDATA[Craig Shallahamer]]></category>
		<category><![CDATA[John Allspaw]]></category>
		<category><![CDATA[Neil Gunther]]></category>
		<category><![CDATA[Queueing Theory]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Universal Scalability Model]]></category>
		<category><![CDATA[capacity planning]]></category>
		<category><![CDATA[scalability]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1946</guid>
		<description><![CDATA[Guerrilla Capacity Planning

Guerrilla Capacity Planning.  By Neil J. Gunther, Springer 2007.  Page count: about 200 pages, plus appendixes.   (Here&#8217;s a link to the publisher&#8217;s site.)

Of all the books I&#8217;ve reviewed, this one has taken me the longest to study first.  That&#8217;s because there is a lot of math involved, and Neil Gunther knows a lot more about it than I do.  Here&#8217;s the short version: I&#8217;m learning how to use this in the real world, but that&#8217;s going to take many months, probably years.  I&#8217;ve already spent about 10 months studying this book, and have read it all the way through twice &#8212; parts of it five times or more.  Needless to say, if I didn&#8217;t think this was a book with value, I wouldn&#8217;t be doing that.  But you&#8217;ll only get out of this book what you put in.  If you want to learn a wholly new way to understand software and hardware scalability, and how to do capacity planning as a result, then buy the book and set aside some study time.  But don&#8217;t think you&#8217;re going to breeze through this book and end up with a simple N-step method to take capacity forecasts to your boss.  If you want that, buy John Allspaw&#8217;s book instead.  (If you&#8217;re reading this blog post, you need that book.)

I don&#8217;t want to spend a lot of time talking about Neil&#8217;s method, because honestly the book isn&#8217;t about the method first and foremost, and I think many readers will have a hard time digging the capacity planning method out of the math-ness.  This book is, in a sense, a textbook or workbook for his training courses.  It begins with a lot of general topics, such as how managers think about capacity, risk, what&#8217;s needed in the world of businesses that are driven by Wall Street, ITIL, and so on.  Then there&#8217;s the mathematical background for the rest of the book, things like significant digits and expressing error.

The part of the book that I&#8217;m still studying begins in Chapter 4, which introduces ways to quantify scalability.  The math begins with Amdahl&#8217;s Law, which you may have heard of.  It turns out that not only can this be used to understand how much overall speedup is possible by speeding up part of a process, which is how I&#8217;m used to using it, but it can be used to model what is possible with parallelization.  (I think I actually learned this in my university classes, but I&#8217;d forgotten its uses in parallel computing since then.)  Anyway, it&#8217;s a straightforward model that makes intuitive sense and is easy to accept.  I believe in it because it&#8217;s so logical and simple, and because I&#8217;ve worked with it for a long time.  That&#8217;s the last bit of math in this book that I can understand so solidly, because after that, we get into a lot of things that have to do with interaction between concurrently performed work, and nothing is ever intuitive about that domain.

Now, when you&#8217;re talking about scalability, you generally are working with scalability of concurrent systems, and queueing theory is Topic Number One.  Proper queueing theory is correctly modeled, under certain very restricted conditions, by the Erlang C formula.  This is a complex bit of math, and although I believe in it, I don&#8217;t understand it enough to know how it&#8217;s derived or proven to be correct.  Well, there&#8217;s no Erlang C math in this book.  Neil Gunther goes a completely different direction.  Instead of modeling the impact of queueing through the math that describes the model, he creates a new model.  Let&#8217;s leave the model for later, and just look at what&#8217;s nice about not using Erlang C math to model computer system scalability:


The Erlang C formula requires complex calculations.
It is valid only in restricted conditions, and it&#8217;s a lot of work to prove that your workload conforms.
It models queueing delay, but it doesn&#8217;t model coherency delay.
It requires inputs such as service time, which are difficult or impossible to measure accurately.


Someone once said that all models are wrong, but some models are useful.  Neil Gunther heads in the direction of a more useful model.  First, he proves that two parameters are necessary and sufficient to create a realistic model.  Next, he introduces another parameter into Amdahl&#8217;s Law to account for coherency delay.  The resulting (still simple) equation models serial delay (the reverse of parallel speedup) and coherency delay.  Now we have a model for how a system scales under a given workload as you increasingly parallelize the hardware.  This is the universal scalability model.  From the mathematical point of view, it&#8217;s the crowning achievement of this book.  I&#8217;m very much summarizing, by the way.  There&#8217;s a lot to think about in developing such a model, so the reader gets quite a tour de force here.  Along the way Neil shows how you can arrive at the same surprising result through an entirely different route, without even using Amdahl&#8217;s Law as a starting point.

There are other models.  Neil discusses these.  They all have problems.  Some don&#8217;t model what we know can happen in the real world &#8212; retrograde scaling &#8212; where performance can decrease when you add more power to a system.  Others  are physically impossible, predicting negative speedup.  Negative speedup means the system&#8217;s performance goes below zero.  As in, you ask it to do work, and it, uh, takes back work it&#8217;s already done?  Impossible.  So it certainly looks like Neil&#8217;s model is the strongest contender.  By the way, Craig Shallahamer&#8217;s book on forecasting Oracle performance uses the universal scalability model, although without the mathematical rigor.

Now, the problem is how to apply this in the real world.  To model a system&#8217;s performance, you have to know the value of those two magical parameters.  How on earth can you find these values?  This seems to be just as hard as Erlang C math.  But Neil shows the second most remarkable thing: if you transform the universal scalability model around a bit, then you get a polynomial of degree two.  This is exciting because if you take some measurements of your system&#8217;s observed performance at different points on the scalability curve (holding the work per processor constant, and adding more processors), and then transform those measurements in an equivalent manner, you can fit a regression curve through those points.  Now you can reverse the transformations to the equation, plug in the coefficients of the quadratic equation that resulted from the curve-fitting, and out come the parameters you need for the universal scalability equation!  Final result: you can extrapolate out beyond your observations and predict the system&#8217;s scalability.

We&#8217;re not done.  All of this was about hardware scalability: &#8220;how much faster will this system run if I add more CPUs?&#8221;  Software scalability is next.  Neil goes back to the basics, starting with how Amdahl&#8217;s Law applies to software speedup, and essentially covers all the same ground we&#8217;ve already covered, but this time modeling what happens when you hold the hardware constant, and increase the concurrency of the workload the software is serving.  It turns out that exactly the same scalability model holds for software as it did for hardware.  This is why he calls it the universal scalability model.  But not only that, it works for multi-tier architectures of arbitrary complexity.

And this is why I say I am not competent to really prove or disprove the validity of the whole thing.  It makes sense to me that even a multi-tier architecture can conform to a model with two parameters.  As we know in the real world, there is usually a single worst bottleneck, a weakest link.  And therefore no matter how complex the architecture, the dominant factors limiting scalability are still coherency and/or queueing at the bottleneck, and how much you can parallelize (Amdahl&#8217;s Law).  Thus, the universal scalability model intuitively might be valid for such architectures.  But proving it &#8212; wow, that&#8217;s way beyond me.  I know my limits.  I&#8217;m taking it all on faith, experience, and intuition at this point.

In my mind, the results Neil Gunther derives up to this point in the book would have been plenty.  However, there&#8217;s lots more left in the book.  The rest of the book is about how to use the model for capacity planning, but surprisingly, it&#8217;s not about just how to use the universal scalability model.  It&#8217;s about Guerrilla Capacity Planning in the real world.  Right after exploring software scalability, he dives into virtualization for a whole chapter &#8212; and then shows you how to measure, model, and predict the scalability of various virtualization technologies.  Next chapter: web site capacity planning.  After that?  &#8220;Gargantuan Computing: GRIDs and P2P.&#8221;  Yep, he analyzes the scalability limits of Gnutella and friends.  And then, apparently just because he can, he dissects arguments about network traffic in general (read: &#8220;how scalable is the Internet?&#8221;).  I can&#8217;t pretend to understand all this myself.  I&#8217;m just following along.

I have a feeling that Neil Gunther is kind of like Einstein: his real gift is his ability to create thought experiments that make the model accessible to mortals.  Maybe someday he&#8217;ll be a legend you learn about in CS101 classes, or maybe someday he&#8217;ll be proven wrong like Newton, who knows.  In the meantime, I&#8217;m going to keep working on applying it all in the real world, especially to MySQL, and see what comes of it.  The fact that I&#8217;m still doing that bears out what I said earlier: you aren&#8217;t going to just waltz through this book and come away with a clear picture of how to work through a capacity planning method.  You&#8217;ll have some work to do.  If you want an elegant and simple capacity planning method, then you should buy John Allspaw&#8217;s The Art Of Capacity Planning instead.

Related posts:A review of The Art of Capacity Planning by John AllspawA review of Forecasting Oracle Performance by Craig ShallahamerA review of SQL and Relational Theory by C. J. DateA review of Optimizing Oracle Performance by Cary MillsapA Review of Beginning Database Design by Clare Churcher]]></description>
			<content:encoded><![CDATA[<div><a href="http://www.amazon.com/Guerrilla-Capacity-Planning-Tactical-Applications/dp/3540261389?tag=xaprb-20"><img src="http://www.xaprb.com/blog/wp-content/uploads/2010/07/guerrilla_capacity_planning.jpg" alt="Guerrilla Capacity Planning" title="Guerrilla Capacity Planning" width="153" height="231" class="size-full wp-image-1949" /></a><p>Guerrilla Capacity Planning</p></div>

<p><a href="http://www.amazon.com/Guerrilla-Capacity-Planning-Tactical-Applications/dp/3540261389?tag=xaprb-20">Guerrilla Capacity Planning</a>.  By Neil J. Gunther, Springer 2007.  Page count: about 200 pages, plus appendixes.   (Here&#8217;s <a href="http://www.springer.com/computer/communication+networks/book/978-3-540-26138-4">a link to the publisher&#8217;s site</a>.)</p>

<p>Of all the books I&#8217;ve reviewed, this one has taken me the longest to study first.  That&#8217;s because there is a lot of math involved, and Neil Gunther knows a lot more about it than I do.  Here&#8217;s the short version: I&#8217;m learning how to use this in the real world, but that&#8217;s going to take many months, probably years.  I&#8217;ve already spent about 10 months studying this book, and have read it all the way through twice &#8212; parts of it five times or more.  Needless to say, if I didn&#8217;t think this was a book with value, I wouldn&#8217;t be doing that.  But you&#8217;ll only get out of this book what you put in.  If you want to learn a wholly new way to understand software and hardware scalability, and how to do capacity planning as a result, then buy the book and set aside some study time.  But don&#8217;t think you&#8217;re going to breeze through this book and end up with a simple N-step method to take capacity forecasts to your boss.  If you want that, buy <a href="http://www.xaprb.com/blog/2009/10/24/a-review-of-the-art-of-capacity-planning-by-john-allspaw/">John Allspaw&#8217;s book</a> instead.  (If you&#8217;re reading this blog post, you need that book.)</p>

<p>I don&#8217;t want to spend a lot of time talking about Neil&#8217;s method, because honestly the book isn&#8217;t about the method first and foremost, and I think many readers will have a hard time digging the capacity planning method out of the math-ness.  This book is, in a sense, a textbook or workbook for his training courses.  It begins with a lot of general topics, such as how managers think about capacity, risk, what&#8217;s needed in the world of businesses that are driven by Wall Street, ITIL, and so on.  Then there&#8217;s the mathematical background for the rest of the book, things like significant digits and expressing error.</p>

<p>The part of the book that I&#8217;m still studying begins in Chapter 4, which introduces ways to quantify scalability.  The math begins with <a href="http://en.wikipedia.org/wiki/Amdahl's_law">Amdahl&#8217;s Law</a>, which you may have heard of.  It turns out that not only can this be used to understand how much overall speedup is possible by speeding up part of a process, which is how I&#8217;m used to using it, but it can be used to model what is possible with parallelization.  (I think I actually learned this in my university classes, but I&#8217;d forgotten its uses in parallel computing since then.)  Anyway, it&#8217;s a straightforward model that makes intuitive sense and is easy to accept.  I believe in it because it&#8217;s so logical and simple, and because I&#8217;ve worked with it for a long time.  That&#8217;s the last bit of math in this book that I can understand so solidly, because after that, we get into a lot of things that have to do with interaction between concurrently performed work, and <em>nothing</em> is ever intuitive about that domain.</p>

<p>Now, when you&#8217;re talking about scalability, you generally are working with scalability of concurrent systems, and queueing theory is Topic Number One.  Proper queueing theory is correctly modeled, under certain very restricted conditions, by the <a href="http://en.wikipedia.org/wiki/Erlang_(unit)#Erlang_C_formula">Erlang C formula</a>.  This is a complex bit of math, and although I believe in it, I don&#8217;t understand it enough to know how it&#8217;s derived or proven to be correct.  Well, there&#8217;s no Erlang C math in this book.  Neil Gunther goes a completely different direction.  Instead of modeling the impact of queueing through the math that describes the model, he creates a new model.  Let&#8217;s leave the model for later, and just look at what&#8217;s nice about <em>not</em> using Erlang C math to model computer system scalability:</p>

<ul>
<li>The Erlang C formula requires complex calculations.</li>
<li>It is valid only in restricted conditions, and <a href="http://carymillsap.blogspot.com/2010/03/robbs-question-about-mmm.html">it&#8217;s a lot of work to prove that your workload conforms</a>.</li>
<li>It models queueing delay, but it doesn&#8217;t model coherency delay.</li>
<li>It requires inputs such as service time, which are difficult or impossible to measure accurately.</li>
</ul>

<p>Someone once said that all models are wrong, but some models are useful.  Neil Gunther heads in the direction of a more useful model.  First, he proves that two parameters are necessary and sufficient to create a realistic model.  Next, he introduces another parameter into Amdahl&#8217;s Law to account for coherency delay.  The resulting (still simple) equation models serial delay (the reverse of parallel speedup) and coherency delay.  Now we have a model for how a system scales <em>under a given workload as you increasingly parallelize the hardware</em>.  This is the <strong>universal scalability model</strong>.  From the mathematical point of view, it&#8217;s the crowning achievement of this book.  I&#8217;m very much summarizing, by the way.  There&#8217;s a lot to think about in developing such a model, so the reader gets quite a tour de force here.  Along the way Neil shows how you can arrive at the same surprising result through an entirely different route, without even using Amdahl&#8217;s Law as a starting point.</p>

<p>There are other models.  Neil discusses these.  They all have problems.  Some don&#8217;t model what we know can happen in the real world &#8212; retrograde scaling &#8212; where performance can decrease when you add more power to a system.  Others  are physically impossible, predicting negative speedup.  Negative speedup means the system&#8217;s performance goes below zero.  As in, you ask it to do work, and it, uh, takes back work it&#8217;s already done?  Impossible.  So it certainly looks like Neil&#8217;s model is the strongest contender.  By the way, <a href="http://www.xaprb.com/blog/2010/05/01/a-review-of-forecasting-oracle-performance-by-craig-shallahamer/">Craig Shallahamer&#8217;s book on forecasting Oracle performance</a> uses the universal scalability model, although without the mathematical rigor.</p>

<p>Now, the problem is how to apply this in the real world.  To model a system&#8217;s performance, you have to know the value of those two magical parameters.  How on earth can you find these values?  This seems to be just as hard as Erlang C math.  But Neil shows the second most remarkable thing: if you transform the universal scalability model around a bit, then <strong>you get a polynomial of degree two</strong>.  This is exciting because if you take some measurements of your system&#8217;s observed performance at different points on the scalability curve (holding the work per processor constant, and adding more processors), and then transform those measurements in an equivalent manner, you can <strong>fit a regression curve</strong> through those points.  Now you can reverse the transformations to the equation, plug in the coefficients of the quadratic equation that resulted from the curve-fitting, and out come the parameters you need for the universal scalability equation!  Final result: you can extrapolate out beyond your observations and predict the system&#8217;s scalability.</p>

<p>We&#8217;re not done.  All of this was about hardware scalability: &#8220;how much faster will this system run if I add more CPUs?&#8221;  Software scalability is next.  Neil goes back to the basics, starting with how Amdahl&#8217;s Law applies to software speedup, and essentially covers all the same ground we&#8217;ve already covered, but this time modeling what happens when you hold the hardware constant, and increase the concurrency of the workload the software is serving.  It turns out that exactly the same scalability model holds for software as it did for hardware.  This is why he calls it the universal scalability model.  But not only that, it works for multi-tier architectures of arbitrary complexity.</p>

<p>And this is why I say I am not competent to really prove or disprove the validity of the whole thing.  It makes sense to me that even a multi-tier architecture can conform to a model with two parameters.  As we know in the real world, there is usually a single worst bottleneck, a weakest link.  And therefore no matter how complex the architecture, the dominant factors limiting scalability are still coherency and/or queueing at the bottleneck, and how much you can parallelize (Amdahl&#8217;s Law).  Thus, the universal scalability model intuitively might be valid for such architectures.  But proving it &#8212; wow, that&#8217;s way beyond me.  I know my limits.  I&#8217;m taking it all on faith, experience, and intuition at this point.</p>

<p>In my mind, the results Neil Gunther derives up to this point in the book would have been plenty.  However, there&#8217;s lots more left in the book.  The rest of the book is about how to use the model for capacity planning, but surprisingly, it&#8217;s not about just how to use the universal scalability model.  It&#8217;s about Guerrilla Capacity Planning in the real world.  Right after exploring software scalability, he dives into virtualization for a whole chapter &#8212; and then shows you how to measure, model, and predict the scalability of various virtualization technologies.  Next chapter: web site capacity planning.  After that?  &#8220;Gargantuan Computing: GRIDs and P2P.&#8221;  Yep, he analyzes the scalability limits of Gnutella and friends.  And then, apparently just because he can, he dissects arguments about network traffic in general (read: &#8220;how scalable is the Internet?&#8221;).  I can&#8217;t pretend to understand all this myself.  I&#8217;m just following along.</p>

<p>I have a feeling that Neil Gunther is kind of like Einstein: his real gift is his ability to create thought experiments that make the model accessible to mortals.  Maybe someday he&#8217;ll be a legend you learn about in CS101 classes, or maybe someday he&#8217;ll be proven wrong like Newton, who knows.  In the meantime, I&#8217;m going to keep working on applying it all in the real world, especially to MySQL, and see what comes of it.  The fact that I&#8217;m still doing that bears out what I said earlier: you aren&#8217;t going to just waltz through this book and come away with a clear picture of how to work through a capacity planning method.  You&#8217;ll have some work to do.  If you want an elegant and simple capacity planning method, then you should buy <a href="http://www.xaprb.com/blog/2009/10/24/a-review-of-the-art-of-capacity-planning-by-john-allspaw/">John Allspaw&#8217;s <em>The Art Of Capacity Planning</em></a> instead.</p>

<p>Related posts:<ol><li><a href="http://www.xaprb.com/blog/2009/10/24/a-review-of-the-art-of-capacity-planning-by-john-allspaw/" rel="bookmark" title="Permanent Link: A review of The Art of Capacity Planning by John Allspaw">A review of The Art of Capacity Planning by John Allspaw</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><li><a href="http://www.xaprb.com/blog/2009/03/29/a-review-of-sql-and-relational-theory-by-c-j-date/" rel="bookmark" title="Permanent Link: A review of SQL and Relational Theory by C. J. Date">A review of SQL and Relational Theory by C. J. Date</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/2009/08/22/a-review-of-beginning-database-design-by-clare-churcher/" rel="bookmark" title="Permanent Link: A Review of Beginning Database Design by Clare Churcher">A Review of Beginning Database Design by Clare Churcher</a></li></ol></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25226&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25226&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/06/a-review-of-guerrilla-capacity-planning-by-neil-gunther/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A review of Cloud Application Architectures by George Reese</title>
		<link>http://www.xaprb.com/blog/2010/07/04/a-review-of-cloud-application-architectures-by-george-reese/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-review-of-cloud-application-architectures-by-george-reese</link>
		<comments>http://www.xaprb.com/blog/2010/07/04/a-review-of-cloud-application-architectures-by-george-reese/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 02:36:28 +0000</pubDate>
		<dc:creator>Baron Schwartz (xaprb)</dc:creator>
				<category><![CDATA[George Reese]]></category>
		<category><![CDATA[John Allspaw]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[gogrid]]></category>
		<category><![CDATA[rackspace]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1937</guid>
		<description><![CDATA[Cloud Application Architectures

Cloud Application Architectures.  By George Reese, O&#8217;Reilly 2009.  (Here&#8217;s a link to the publisher&#8217;s site).

This is a great book on how to build apps in the cloud!  I was happy to see how much depth it went into.  It&#8217;s short &#8212; 150 pages plus some appendixes &#8212; so I was expecting it to be a superficial overview.  But it isn&#8217;t.  It is thorough.  And it is also obviously built on his own experience building very specific applications that he uses to run his business &#8212; he isn&#8217;t preaching about stuff he doesn&#8217;t know first-hand.  Finally, George Reese is a good writer!  It&#8217;s impressive.  This is how he covers so much ground with so much depth in so few pages, and it all makes sense.  He takes a side trip every now and then, but it&#8217;s always in the right place at the right time &#8212; how to do a snapshot for backups, for example &#8212; and isn&#8217;t distracting.  For a technical book, it has an amazing narrative flow.

The book begins with an intro to cloud computing in general, with definitions and an explanation of different models, plus cost estimates of traditional IT, managed hosting, and cloud computing for an app. There&#8217;s a brief overview of the Amazon platform.  This book is mostly about Amazon, and states that up front.  There are references and comparisons to other providers throughout, and later there&#8217;ll be two appendixes on GoGrid and Rackspace, each written by a representative of that company.  I was happy that the author brought in people to write those, instead of doing it himself.  They are non-promotional in nature, and quite short.  That adds value to the book, which would have been fine without them, honestly.

Back to chapter two now &#8212; a deeper introduction to Amazon, moving through all the major components, but especially EC2, S3, and EBS.  Here we also start to see a focus on the platform as a whole &#8212; availability zones, security, redundancy, reliability.  These topics are treated fairly and woven into every chapter.  It&#8217;s clear that the author doesn&#8217;t want to isolate these topics, but rather explain them in context so your mind is always on them as each new topic is introduced.  Chapter 3 picks all this up again: considering a move into the cloud?  More cost comparisons, more explanations of concepts such as availability and how they translate into the Amazon cloud.  Performance, disaster recovery and a few other topics show up here.

Chapter 4 is about how to build an app in the cloud: web app design, making multiple machines work together, handling failure, building AMIs, privacy, and operating databases (especially MySQL) in the cloud.  The privacy section is particularly good.  I&#8217;d recommend this to anyone building an app that might process personally identifiable information or financial information, in or out of the cloud.  And as I said already, this is one of the types of things he weaves into the whole book.  Chapter 5 picks right up and keeps going: it&#8217;s about security.  Data security, regulatory compliance, network security, host security, how to respond if there&#8217;s a breach.  And then Chapter 6 is on disaster recovery: planning, implementing, managing.

Chapter 7 is titled &#8220;scaling,&#8221; but it&#8217;s more than that.  It starts with capacity planning.  Here&#8217;s one of my favorite quotes: &#8220;some think they no longer need to engage in capacity planning&#8230; [others] think of tens or hundreds of thousands of dollars in consulting fees.  Both thoughts are dangerous myths&#8230;&#8221; There&#8217;s a reference to John Allspaw&#8217;s excellent book on capacity planning.  (I saw that he was a tech reviewer for this book, too.)  This chapter covers how you predict and provision for capacity needs in the cloud, including the &#8220;automatic scaling&#8221; holy grail, how it can bite you, and how to keep that from happening.  It also talks about how you scale vertically in the cloud.  It doesn&#8217;t talk about why it&#8217;s hard to really be sure about your capacity needs in the cloud, but that&#8217;s okay given the other material covered in the chapter.

And that&#8217;s it!  After this, it&#8217;s 3 appendixes.  One is an AWS reference, and then there&#8217;s the two on GoGrid and Rackspace.

What&#8217;s to criticize?  Well, not a lot really.  I read every word in this book, I promise.  Here&#8217;s what I noticed: he talked about database corruption from unexpected shutdowns &#8212; he should have said &#8220;use InnoDB,&#8221; because that&#8217;s pretty much a MyISAM problem.  He talked about taking backups from replication slaves &#8212; he should have said &#8220;don&#8217;t just trust replication, verify it with mk-table-checksum.&#8221;  I also think he encourages a little too much trust that cloud providers are always magically going to have the capacity you need; it felt a bit naive, but this is actually a fundamental point in whether you&#8217;re going to use the cloud or not.  Nobody knows how much excess capacity Amazon has, and as we know, weird things happen.  But if you&#8217;re going to embrace a cloud platform, you&#8217;re going to have to trust to a certain extent.

A couple other things to nitpick: in Chapter 1, when talking about availability, he writes &#8220;[if] even 1 minute of downtime in a year is entirely unacceptable, you almost certainly want to opt for a managed services environment&#8230; [if] 99.995% is good enough, you can&#8217;t beat the cloud.&#8221; But these numbers are unrealistic and don&#8217;t have enough context to explain what he means.  Finally, in a couple of places he talks about algorithms for generating unique identifiers and dealing with concurrent access, but these don&#8217;t have a deep enough explanation to prevent novices from shooting themselves in the foot with wrong assumptions such as a timestamp will always increase between each subsequent access.  But a savvy developer will recognize those problems and won&#8217;t be bitten.

This book is the first one to go onto my list of essential books in a while.  I&#8217;ll be keeping this one on my own bookshelf.

Related posts:Review of Scalable Internet Architectures by Theo SchlossnagleUnder-provisioning: the curse of the cloudA review of The Art of Capacity Planning by John AllspawA review of Web Operations by John Allspaw and Jesse RobbinsBook Review: Building powerful and robust websites with Drupal 6]]></description>
			<content:encoded><![CDATA[<div><a href="http://www.amazon.com/dp/0596156367?tag=xaprb-20"><img src="http://www.xaprb.com/blog/wp-content/uploads/2010/07/cloud_application_architectures.gif" alt="Cloud Application Architectures" title="Cloud Application Architectures" width="180" height="236" class="size-full wp-image-1938" /></a><p>Cloud Application Architectures</p></div>

<p><a href="http://www.amazon.com/dp/0596156367?tag=xaprb-20">Cloud Application Architectures</a>.  By George Reese, O&#8217;Reilly 2009.  (Here&#8217;s <a href="http://oreilly.com/catalog/9780596156374">a link to the publisher&#8217;s site</a>).</p>

<p>This is a great book on how to build apps in the cloud!  I was happy to see how much depth it went into.  It&#8217;s short &#8212; 150 pages plus some appendixes &#8212; so I was expecting it to be a superficial overview.  But it isn&#8217;t.  It is thorough.  And it is also obviously built on his own experience building very specific applications that he uses to run his business &#8212; he isn&#8217;t preaching about stuff he doesn&#8217;t know first-hand.  Finally, George Reese is a good writer!  It&#8217;s impressive.  This is how he covers so much ground with so much depth in so few pages, and it all makes sense.  He takes a side trip every now and then, but it&#8217;s always in the right place at the right time &#8212; how to do a snapshot for backups, for example &#8212; and isn&#8217;t distracting.  For a technical book, it has an amazing narrative flow.</p>

<p>The book begins with an intro to cloud computing in general, with definitions and an explanation of different models, plus cost estimates of traditional IT, managed hosting, and cloud computing for an app. There&#8217;s a brief overview of the Amazon platform.  This book is mostly about Amazon, and states that up front.  There are references and comparisons to other providers throughout, and later there&#8217;ll be two appendixes on GoGrid and Rackspace, each written by a representative of that company.  I was happy that the author brought in people to write those, instead of doing it himself.  They are non-promotional in nature, and quite short.  That adds value to the book, which would have been fine without them, honestly.</p>

<p>Back to chapter two now &#8212; a deeper introduction to Amazon, moving through all the major components, but especially EC2, S3, and EBS.  Here we also start to see a focus on the platform as a whole &#8212; availability zones, security, redundancy, reliability.  These topics are treated fairly and woven into every chapter.  It&#8217;s clear that the author doesn&#8217;t want to isolate these topics, but rather explain them in context so your mind is always on them as each new topic is introduced.  Chapter 3 picks all this up again: considering a move into the cloud?  More cost comparisons, more explanations of concepts such as availability and how they translate into the Amazon cloud.  Performance, disaster recovery and a few other topics show up here.</p>

<p>Chapter 4 is about how to build an app in the cloud: web app design, making multiple machines work together, handling failure, building AMIs, privacy, and operating databases (especially MySQL) in the cloud.  The privacy section is particularly good.  I&#8217;d recommend this to anyone building an app that might process personally identifiable information or financial information, in or out of the cloud.  And as I said already, this is one of the types of things he weaves into the whole book.  Chapter 5 picks right up and keeps going: it&#8217;s about security.  Data security, regulatory compliance, network security, host security, how to respond if there&#8217;s a breach.  And then Chapter 6 is on disaster recovery: planning, implementing, managing.</p>

<p>Chapter 7 is titled &#8220;scaling,&#8221; but it&#8217;s more than that.  It starts with capacity planning.  Here&#8217;s one of my favorite quotes: &#8220;some think they no longer need to engage in capacity planning&#8230; [others] think of tens or hundreds of thousands of dollars in consulting fees.  Both thoughts are dangerous myths&#8230;&#8221; There&#8217;s a reference to <a href="http://www.xaprb.com/blog/2009/10/24/a-review-of-the-art-of-capacity-planning-by-john-allspaw/">John Allspaw&#8217;s excellent book on capacity planning</a>.  (I saw that he was a tech reviewer for this book, too.)  This chapter covers how you predict and provision for capacity needs in the cloud, including the &#8220;automatic scaling&#8221; holy grail, how it can bite you, and how to keep that from happening.  It also talks about how you scale vertically in the cloud.  It doesn&#8217;t talk about why <a href="http://www.xaprb.com/blog/2010/06/01/under-provisioning-the-curse-of-the-cloud/">it&#8217;s hard to really be sure about your capacity needs in the cloud</a>, but that&#8217;s okay given the other material covered in the chapter.</p>

<p>And that&#8217;s it!  After this, it&#8217;s 3 appendixes.  One is an AWS reference, and then there&#8217;s the two on GoGrid and Rackspace.</p>

<p>What&#8217;s to criticize?  Well, not a lot really.  I read every word in this book, I promise.  Here&#8217;s what I noticed: he talked about database corruption from unexpected shutdowns &#8212; he should have said &#8220;use InnoDB,&#8221; because that&#8217;s pretty much a MyISAM problem.  He talked about taking backups from replication slaves &#8212; he should have said &#8220;don&#8217;t just trust replication, verify it with mk-table-checksum.&#8221;  I also think he encourages a little too much trust that cloud providers are always magically going to have the capacity you need; it felt a bit naive, but this is actually a fundamental point in whether you&#8217;re going to use the cloud or not.  Nobody knows how much excess capacity Amazon has, and as we know, <a href="http://en.wikipedia.org/wiki/Northeast_Blackout_of_2003">weird things happen</a>.  But if you&#8217;re going to embrace a cloud platform, you&#8217;re going to have to trust to a certain extent.</p>

<p>A couple other things to nitpick: in Chapter 1, when talking about availability, he writes &#8220;[if] even 1 minute of downtime in a year is entirely unacceptable, you almost certainly want to opt for a managed services environment&#8230; [if] 99.995% is good enough, you can&#8217;t beat the cloud.&#8221; But these numbers are unrealistic and don&#8217;t have enough context to explain what he means.  Finally, in a couple of places he talks about algorithms for generating unique identifiers and dealing with concurrent access, but these don&#8217;t have a deep enough explanation to prevent novices from shooting themselves in the foot with wrong assumptions such as <em>a timestamp will always increase between each subsequent access.</em>  But a savvy developer will recognize those problems and won&#8217;t be bitten.</p>

<p>This book is the first one to go onto <a href="http://www.xaprb.com/blog/essential-books/">my list of essential books</a> in a while.  I&#8217;ll be keeping this one on my own bookshelf.</p>

<p>Related posts:<ol><li><a href="http://www.xaprb.com/blog/2009/02/21/review-of-scalable-internet-architectures-by-theo-schlossnagle/" rel="bookmark" title="Permanent Link: Review of Scalable Internet Architectures by Theo Schlossnagle">Review of Scalable Internet Architectures by Theo Schlossnagle</a></li><li><a href="http://www.xaprb.com/blog/2010/06/01/under-provisioning-the-curse-of-the-cloud/" rel="bookmark" title="Permanent Link: Under-provisioning: the curse of the cloud">Under-provisioning: the curse of the cloud</a></li><li><a href="http://www.xaprb.com/blog/2009/10/24/a-review-of-the-art-of-capacity-planning-by-john-allspaw/" rel="bookmark" title="Permanent Link: A review of The Art of Capacity Planning by John Allspaw">A review of The Art of Capacity Planning by John Allspaw</a></li><li><a href="http://www.xaprb.com/blog/2010/07/03/a-review-of-web-operations-by-john-allspaw-and-jesse-robbins/" rel="bookmark" title="Permanent Link: A review of Web Operations by John Allspaw and Jesse Robbins">A review of Web Operations by John Allspaw and Jesse Robbins</a></li><li><a href="http://www.xaprb.com/blog/2008/07/20/book-review-building-powerful-and-robust-websites-with-drupal-6/" rel="bookmark" title="Permanent Link: Book Review: Building powerful and robust websites with Drupal 6">Book Review: Building powerful and robust websites with Drupal 6</a></li></ol></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25205&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25205&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/04/a-review-of-cloud-application-architectures-by-george-reese/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A review of Web Operations by John Allspaw and Jesse Robbins</title>
		<link>http://www.xaprb.com/blog/2010/07/03/a-review-of-web-operations-by-john-allspaw-and-jesse-robbins/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-review-of-web-operations-by-john-allspaw-and-jesse-robbins</link>
		<comments>http://www.xaprb.com/blog/2010/07/03/a-review-of-web-operations-by-john-allspaw-and-jesse-robbins/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 02:02:27 +0000</pubDate>
		<dc:creator>Baron Schwartz (xaprb)</dc:creator>
				<category><![CDATA[Brian Moon]]></category>
		<category><![CDATA[Eric Florenzano]]></category>
		<category><![CDATA[Eric Ries]]></category>
		<category><![CDATA[Heather Champ]]></category>
		<category><![CDATA[Jake Loomis]]></category>
		<category><![CDATA[Jesse Robbins]]></category>
		<category><![CDATA[John Allspaw]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Operations]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Richard Cook]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Sys-Admin]]></category>
		<category><![CDATA[Theo Schlossnagle]]></category>
		<category><![CDATA[Web Operations]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1924</guid>
		<description><![CDATA[Web Operations

Web Operations.  By John Allspaw and Jesse Robbins, O&#8217;Reilly 2010, with a chapter by myself.  (Here&#8217;s a link to the publisher&#8217;s site).

I wrote a chapter for this book, and it&#8217;s now on shelves in bookstores near you.  I got my dead-tree copy today and read everyone else&#8217;s contributions to it.  It&#8217;s a good book. A group effort such as this one is necessarily going to have some differences in style and even overlapping content, but overall it works very well.  It includes chapters from some really smart people, some of whom I was not previously familiar with.  John and Jesse obviously have good connections.  A lot of the folks are from Flickr.

Here are the highlights in my opinion.


Theo Schlossnagle, who has a place on my list of essential books, opens things with an overview of what web operations really is, and why it&#8217;s hard.  Don&#8217;t skip this.  Theo&#8217;s introduction is concise and thoughtful.
Eric Ries discusses the benefits of continuous deployment.  He is right on the money.  Right out of college I spent 3 years as a developer at a company with very little engineering discipline, and then left for another company built by a small ace team practicing extreme programming.  Eric nails the benefits of continuous deployment &#8212; he really gets it.  I hadn&#8217;t heard of Eric before, but now I&#8217;ve subscribed to his blog.
John Allspaw (whose book on capacity planning is also on my list of essentials) and Richard Cook discuss how complex systems fail.  This chapter appeared in part as a whitepaper and blog post on John&#8217;s blog, and is expanded in this book.  I have spent a lot of time examining failures for clients, and as VP of Consulting, also a lot of time examining Percona&#8217;s own mistakes.  I fully agree with the conclusions in this chapter.  A few key points: there is never a single root cause; our desire to find one blinds us and keeps us from learning; true failures are inherently unpredictable and happen only when a series of things fails; avoiding failure requires experience with failure.  This echoes another book I&#8217;ve read recently, The Black Swan.
Brian Moon&#8217;s chapter on unexpected traffic spikes.  If you get a chance to hear Brian speak, take it.  He&#8217;s an engaging guy with interesting and relevant stories to tell.  Stories are always a better experience than bullet points.
Jake Loomis&#8217;s chapter on postmortems.  My own research into prevention of emergencies agrees almost perfectly with his list of things to do on page 225.  Read this chapter carefully!  Now, knowing how to put this into action is hard &#8212; very hard &#8212; but at least you&#8217;ll have a place to start.  The worst compliment I ever got after fixing a system that&#8217;d run out of hard drive space (due to utter lack of basic monitoring) was that I&#8217;d &#8220;saved the day.&#8221;  Baloney.  Postmortems can be a great way to learn your infrastructure&#8217;s weaknesses and prevent emergencies in the future.  I&#8217;m fully confident that this particular client will again deploy new servers without adding them into Nagios, and the results will be predictable.
Naturally, my chapter about choosing a relational database architecture for web applications (skewed towards MySQL).  There is a chapter on NoSQL databases by Eric Florenzano as well, but it is more introductionary-level.


What wasn&#8217;t so good?  I didn&#8217;t get a lot of value out of John&#8217;s interview with Heather Champ, on community management and web operations.  I did not think the interview format worked well in a book full of essays.  But that might just be me.  Also, a couple of places in two or three chapters felt a bit rant-ish without a lot of clear actionable advice; I think readers won&#8217;t get so much out of this.

Overall, though, this is a great book, badly needed, on a topic that is simply not yet recognized for its true importance.  As Theo writes, we&#8217;re seeing the emergence of web operations as a very large profession; it&#8217;s one whose definition is not yet formalized or agreed-upon, but that&#8217;ll change.  It&#8217;s too important not to.  Jesse&#8217;s introduction repeats this sentiment: the world now relies on the web, and so the world relies also on the engineers who make it run.  Web operations is work that matters.

Related posts:A review of The Art of Capacity Planning by John AllspawMy chapter in the forthcoming Web Operations bookReview of Scalable Internet Architectures by Theo SchlossnagleA review of Cacti 0.8 Network Monitoring by Dinangkur Kundu and S. M. Ibrahim LavluA review of Optimizing Oracle Performance by Cary Millsap]]></description>
			<content:encoded><![CDATA[<div><a href="http://www.amazon.com/Web-Operations-Keeping-Data-Time/dp/1449377440?tag=xaprb-20"><img src="http://www.xaprb.com/blog/wp-content/uploads/2010/05/web_operations.gif" alt="Web Operations" title="Web Operations" width="180" height="236" class="size-full wp-image-1864" /></a><p>Web Operations</p></div>

<p><a href="http://www.amazon.com/Web-Operations-Keeping-Data-Time/dp/1449377440?tag=xaprb-20">Web Operations</a>.  By John Allspaw and Jesse Robbins, O&#8217;Reilly 2010, with a chapter by myself.  (Here&#8217;s <a href="http://oreilly.com/catalog/0636920000136">a link to the publisher&#8217;s site</a>).</p>

<p>I wrote a chapter for this book, and it&#8217;s now on shelves in bookstores near you.  I got my dead-tree copy today and read everyone else&#8217;s contributions to it.  It&#8217;s a good book. A group effort such as this one is necessarily going to have some differences in style and even overlapping content, but overall it works very well.  It includes chapters from some really smart people, some of whom I was not previously familiar with.  John and Jesse obviously have good connections.  A lot of the folks are from Flickr.</p>

<p>Here are the highlights in my opinion.</p>

<ul>
<li>Theo Schlossnagle, who has a place on my list of <a href="http://www.xaprb.com/blog/essential-books">essential books</a>, opens things with an overview of what web operations really is, and why it&#8217;s hard.  Don&#8217;t skip this.  Theo&#8217;s introduction is concise and thoughtful.</li>
<li>Eric Ries discusses the benefits of continuous deployment.  He is right on the money.  Right out of college I spent 3 years as a developer at a company with very little engineering discipline, and then left for another company built by a small ace team practicing extreme programming.  Eric nails the benefits of continuous deployment &#8212; he really gets it.  I hadn&#8217;t heard of Eric before, but now I&#8217;ve subscribed to <a href="http://www.startuplessonslearned.com/">his blog</a>.</li>
<li>John Allspaw (whose book on capacity planning is also on my list of essentials) and Richard Cook discuss how complex systems fail.  This chapter appeared in part as a <a href="http://www.kitchensoap.com/2009/11/12/how-complex-systems-fail-a-webops-perspective/">whitepaper and blog post on John&#8217;s blog</a>, and is expanded in this book.  I have spent a lot of time examining failures for clients, and as VP of Consulting, also a lot of time examining Percona&#8217;s own mistakes.  I fully agree with the conclusions in this chapter.  A few key points: there is never a single root cause; our desire to find one blinds us and keeps us from learning; <em>true</em> failures are inherently unpredictable and happen only when a series of things fails; avoiding failure requires experience with failure.  This echoes another book I&#8217;ve read recently, <a href="http://www.amazon.com/Black-Swan-Impact-Highly-Improbable/dp/1400063515?tag=xaprb-20">The Black Swan</a>.</li>
<li><a href="http://brian.moonspot.net/">Brian Moon&#8217;s</a> chapter on unexpected traffic spikes.  If you get a chance to hear Brian speak, take it.  He&#8217;s an engaging guy with interesting and relevant stories to tell.  Stories are always a better experience than bullet points.</li>
<li>Jake Loomis&#8217;s chapter on postmortems.  My own research into prevention of emergencies agrees almost perfectly with his list of things to do on page 225.  Read this chapter carefully!  Now, knowing how to put this into action is hard &#8212; very hard &#8212; but at least you&#8217;ll have a place to start.  The worst compliment I ever got after fixing a system that&#8217;d run out of hard drive space (due to utter lack of basic monitoring) was that I&#8217;d &#8220;saved the day.&#8221;  Baloney.  Postmortems can be a great way to learn your infrastructure&#8217;s weaknesses and prevent emergencies in the future.  I&#8217;m fully confident that this particular client will again deploy new servers without adding them into Nagios, and the results will be predictable.</li>
<li>Naturally, my chapter about choosing a relational database architecture for web applications (skewed towards MySQL).  There is a chapter on NoSQL databases by Eric Florenzano as well, but it is more introductionary-level.</li>
</ul>

<p>What wasn&#8217;t so good?  I didn&#8217;t get a lot of value out of John&#8217;s interview with Heather Champ, on community management and web operations.  I did not think the interview format worked well in a book full of essays.  But that might just be me.  Also, a couple of places in two or three chapters felt a bit rant-ish without a lot of clear actionable advice; I think readers won&#8217;t get so much out of this.</p>

<p>Overall, though, this is a great book, badly needed, on a topic that is simply not yet recognized for its true importance.  As Theo writes, we&#8217;re seeing the emergence of web operations as a very large profession; it&#8217;s one whose definition is not yet formalized or agreed-upon, but that&#8217;ll change.  It&#8217;s too important not to.  Jesse&#8217;s introduction repeats this sentiment: the world now relies on the web, and so the world relies also on the engineers who make it run.  Web operations is work that matters.</p>

<p>Related posts:<ol><li><a href="http://www.xaprb.com/blog/2009/10/24/a-review-of-the-art-of-capacity-planning-by-john-allspaw/" rel="bookmark" title="Permanent Link: A review of The Art of Capacity Planning by John Allspaw">A review of The Art of Capacity Planning by John Allspaw</a></li><li><a href="http://www.xaprb.com/blog/2010/05/20/my-chapter-in-the-forthcoming-web-operations-book/" rel="bookmark" title="Permanent Link: My chapter in the forthcoming Web Operations book">My chapter in the forthcoming Web Operations book</a></li><li><a href="http://www.xaprb.com/blog/2009/02/21/review-of-scalable-internet-architectures-by-theo-schlossnagle/" rel="bookmark" title="Permanent Link: Review of Scalable Internet Architectures by Theo Schlossnagle">Review of Scalable Internet Architectures by Theo Schlossnagle</a></li><li><a href="http://www.xaprb.com/blog/2010/01/09/review-cacti-network-monitoring-kundu-lavlu/" rel="bookmark" title="Permanent Link: A review of Cacti 0.8 Network Monitoring by Dinangkur Kundu and S. M. Ibrahim Lavlu">A review of Cacti 0.8 Network Monitoring by Dinangkur Kundu and S. M. Ibrahim Lavlu</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></ol></p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25203&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25203&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/07/03/a-review-of-web-operations-by-john-allspaw-and-jesse-robbins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A life among databases&#8230;</title>
		<link>http://karlssonondatabases.blogspot.com/2010/07/life-among-databases.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-life-among-databases</link>
		<comments>http://karlssonondatabases.blogspot.com/2010/07/life-among-databases.html#comments</comments>
		<pubDate>Sat, 03 Jul 2010 12:44:00 +0000</pubDate>
		<dc:creator>Anders Karlsson</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-9144505959002328789.post-2283667862031248389</guid>
		<description><![CDATA[A long time ago, in the early 1980's, I decided to change jobs. I was a young guy, with no real experience of  commercial software or anything like that, rather I was a self-taught sysadmin for an ancient UNix system. The company I worked for was in the Telco business, so I looked for another job where I could develop myself and at the same to use my telco knowledge.I found a Telco startup, privately held. I must say that the fact that it was privately held meant nothing to me at the time. Nothing. They were building a system, the servers were VAXes running VMS, and again a became a sysadmin.Having been sysadmin at this company for a while, building up the central datacenter (to be honest, in todays words, that was what I was doing, but at the time, I had no real clue. I was mosr enthusiastic and ready to take on any task than I was smart or intelligent or knew what I was doing, really). But I wanted to develop myself, and at the previous job I had learnt to code in C (it was a Unix system after all), so I slowly migrated into database development, managing sysadmin duties on the side.Still, I wasn't truly professional I think. But I was willing to work and I was persistent and just wouldn't let go. I came to the office dressed in a pair of Jeans and a T-Shirt, and wasn't really aware that sometimes it would be a good idea to dress up or something (this was the 1980's still, so that might have been a good idea back then).As a developer, I realized that the system used a database, and a SQL database! I had no clue whatsoever what this was. But I started writing code creating tables and working my way through this, learning as I went. That you needed something called an "INDEX" became obvious to me after I had shown my latest creating to my colleagues and the things was just soooo slow. In the end, I actually picked up the manual for that "SQL Database", whatever THAT was.After about a year at this company, they decided to move their operations abroad, and I wanted to stay in Sweden, so I went looking for another job. The company behind the SQL Database I had used was looking for people it seemed, so I applied for a job. What it was like working for a US based software company was something I had no clue about. I got the job and turned up for my duties as a support engineer dressed in Jeans and a T-Shirt, and got to work. What a support engineer was really supposed to be doing wasn't something I really knew, it was more along the lines of people calling me with questions, and I tried to help them, as best as I could.The company in question was Oracle. And Oracle really did support me, and courage me, to develop myself, to go to training classes (I didn't ask for these, I was just sent away on them), to take on other jobs inside the organization to to develop my technical and business skills.For all this, I am grateful. Oracle largely shaped me for my future career among database companies, and if that is a good or bad thing is up for you to decide. Now I'm back at Oracle, and I still enjoy it. I am aware that not everyone will agree with me here, but I am glad to be back, after nearly 20 years after I left, and many things with this geart company is still around.All in all, I'm sure Oracle is a good home for MySQL. You may think differently, but I am honored to work for Oracle, and even more so with MySQL at Oracle. Frankly, I can't see that it can get any better./Karlsson]]></description>
			<content:encoded><![CDATA[A <span>long</span> <span>time</span> <span>ago</span>, in <span>the</span> <span>early</span> 1980's, I <span>decided</span> <span>to</span> <span>change</span> <span>jobs.</span> I <span>was</span> a <span>young</span> <span>guy</span>, <span>with</span> <span>no</span> real <span>experience</span> <span>of</span>  <span>commercial</span> <span>software</span> <span>or</span> <span>anything</span> like <span>that</span>, <span>rather</span> I <span>was</span> a <span>self-taught</span> <span>sysadmin</span> for an <span>ancient</span> <span>UNix</span> system. <span>The</span> <span>company</span> I <span>worked</span> for <span>was</span> in <span>the</span> <span>Telco</span> <span>business</span>, so I <span>looked</span> for <span>another</span> <span>job</span> <span>where</span> I <span>could</span> <span>develop</span> <span>myself</span> and <span>at</span> <span>the</span> same <span>to</span> <span>use</span> <span>my</span> <span>telco</span> <span>knowledge.</span><br /><br />I <span>found</span> a <span>Telco</span> <span>startup</span>, <span>privately</span> <span>held.</span> I must <span>say</span> <span>that</span> <span>the</span> <span>fact</span> <span>that</span> <span>it</span> <span>was</span> <span>privately</span> <span>held</span> <span>meant</span> <span>nothing</span> <span>to</span> <span>me</span> <span>at</span> <span>the</span> <span>time.</span> <span>Nothing.</span> <span>They</span> <span>were</span> <span>building</span> a system, <span>the</span> servers <span>were</span> <span>VAXes</span> <span>running</span> <span>VMS</span>, and <span>again</span> a <span>became</span> a <span>sysadmin.</span><br /><br /><span>Having</span> <span>been</span> <span>sysadmin</span> <span>at</span> <span>this</span> <span>company</span> for a <span>while</span>, <span>building</span> <span>up</span> <span>the</span> central datacenter (<span>to</span> be honest, in <span>todays</span> <span>words</span>, <span>that</span> <span>was</span> <span>what</span> I <span>was</span> <span>doing</span>, <span>but</span> <span>at</span> <span>the</span> <span>time</span>, I <span>had</span> <span>no</span> real <span>clue.</span> I <span>was</span> <span>mosr</span> <span>enthusiastic</span> and <span>ready</span> <span>to</span> <span>take</span> <span>on</span> <span>any</span> <span>task</span> <span>than</span> I <span>was</span> smart <span>or</span> intelligent <span>or</span> <span>knew</span> <span>what</span> I <span>was</span> <span>doing</span>, <span>really</span>). <span>But</span> I <span>wanted</span> <span>to</span> <span>develop</span> <span>myself</span>, and <span>at</span> <span>the</span> <span>previous</span> <span>job</span> I <span>had</span> <span>learnt</span> <span>to</span> <span>code</span> in C (<span>it</span> <span>was</span> a Unix system <span>after</span> all), so I <span>slowly</span> <span>migrated</span> <span>into</span> <span>database</span> <span>development</span>, <span>managing</span> <span>sysadmin</span> <span>duties</span> <span>on</span> <span>the</span> <span>side.</span><br /><br />Still, I <span>wasn't</span> <span>truly</span> <span>professional</span> I <span>think.</span> <span>But</span> I <span>was</span> <span>willing</span> <span>to</span> <span>work</span> and I <span>was</span> <span>persistent</span> and just <span>wouldn't</span> <span>let</span> <span>go.</span> I <span>came</span> <span>to</span> <span>the</span> <span>office</span> <span>dressed</span> in a <span>pair</span> <span>of</span> Jeans and a <span>T-Shirt</span>, and <span>wasn't</span> <span>really</span> <span>aware</span> <span>that</span> <span>sometimes</span> <span>it</span> <span>would</span> be a <span>good</span> <span>idea</span> <span>to</span> dress <span>up</span> <span>or</span> <span>something</span> (<span>this</span> <span>was</span> <span>the</span> 1980's still, so <span>that</span> <span>might</span> <span>have</span> <span>been</span> a <span>good</span> <span>idea</span> back <span>then</span>).<br /><br />As a <span>developer</span>, I <span>realized</span> <span>that</span> <span>the</span> system <span>used</span> a <span>database</span>, and a <span>SQL</span> <span>database</span>! I <span>had</span> <span>no</span> <span>clue</span> <span>whatsoever</span> <span>what</span> <span>this</span> <span>was.</span> <span>But</span> I <span>started</span> <span>writing</span> <span>code</span> <span>creating</span> <span>tables</span> and <span>working</span> <span>my</span> <span>way</span> <span>through</span> <span>this</span>, <span>learning</span> as I <span>went.</span> <span>That</span> <span>you</span> <span>needed</span> <span>something</span> <span>called</span> an "INDEX" <span>became</span> <span>obvious</span> <span>to</span> <span>me</span> <span>after</span> I <span>had</span> <span>shown</span> <span>my</span> latest <span>creating</span> <span>to</span> <span>my</span> <span>colleagues</span> and <span>the</span> <span>things</span> <span>was</span> just <span>soooo</span> <span>slow.</span> In <span>the</span> <span>end</span>, I <span>actually</span> <span>picked</span> <span>up</span> <span>the</span> manual for <span>that</span> "<span>SQL</span> <span>Database</span>", <span>whatever</span> <span>THAT</span> <span>was.</span><br /><br /><span>After</span> <span>about</span> a <span>year</span> <span>at</span> <span>this</span> <span>company</span>, <span>they</span> <span>decided</span> <span>to</span> <span>move</span> <span>their</span> operations <span>abroad</span>, and I <span>wanted</span> <span>to</span> <span>stay</span> in <span>Sweden</span>, so I <span>went</span> <span>looking</span> for <span>another</span> <span>job.</span> <span>The</span> <span>company</span> <span>behind</span> <span>the</span> <span>SQL</span> <span>Database</span> I <span>had</span> <span>used</span> <span>was</span> <span>looking</span> for <span>people</span> <span>it</span> <span>seemed</span>, so I <span>applied</span> for a <span>job.</span> <span>What</span> <span>it</span> <span>was</span> like <span>working</span> for a <span>US</span> <span>based</span> <span>software</span> <span>company</span> <span>was</span> <span>something</span> I <span>had</span> <span>no</span> <span>clue</span> <span>about.</span> I got <span>the</span> <span>job</span> and turned <span>up</span> for <span>my</span> <span>duties</span> as a support <span>engineer</span> <span>dressed</span> in Jeans and a <span>T-Shirt</span>, and got <span>to</span> <span>work.</span> <span>What</span> a support <span>engineer</span> <span>was</span> <span>really</span> <span>supposed</span> <span>to</span> be <span>doing</span> <span>wasn't</span> <span>something</span> I <span>really</span> <span>knew</span>, <span>it</span> <span>was</span> <span>more</span> <span>along</span> <span>the</span> <span>lines</span> <span>of</span> <span>people</span> <span>calling</span> <span>me</span> <span>with</span> <span>questions</span>, and I <span>tried</span> <span>to</span> <span>help</span> <span>them</span>, as best as I <span>could.</span><br /><br /><span>The</span> <span>company</span> in <span>question</span> <span>was</span> <span>Oracle.</span> And <span>Oracle</span> <span>really</span> <span>did</span> support <span>me</span>, and <span>courage</span> <span>me</span>, <span>to</span> <span>develop</span> <span>myself</span>, <span>to</span> <span>go</span> <span>to</span> <span>training</span> <span>classes</span> (I <span>didn't</span> ask for <span>these</span>, I <span>was</span> just sent <span>away</span> <span>on</span> <span>them</span>), <span>to</span> <span>take</span> <span>on</span> <span>other</span> <span>jobs</span> <span>inside</span> <span>the</span> <span>organization</span> <span>to</span> <span>to</span> <span>develop</span> <span>my</span> <span>technical</span> and <span>business</span> <span>skills.</span><br /><br />For all <span>this</span>, I <span>am</span> <span>grateful.</span> <span>Oracle</span> <span>largely</span> <span>shaped</span> <span>me</span> for <span>my</span> <span>future</span> <span>career</span> <span>among</span> <span>database</span> <span>companies</span>, and <span>if</span> <span>that</span> is a <span>good</span> <span>or</span> bad <span>thing</span> is <span>up</span> for <span>you</span> <span>to</span> <span>decide.</span> <span>Now</span> <span>I'm</span> back <span>at</span> <span>Oracle</span>, and I still <span>enjoy</span> <span>it.</span> I <span>am</span> <span>aware</span> <span>that</span> not <span>everyone</span> <span>will</span> <span>agree</span> <span>with</span> <span>me</span> <span>here</span>, <span>but</span> I <span>am</span> glad <span>to</span> be back, <span>after</span> <span>nearly</span> 20 <span>years</span> <span>after</span> I <span>left</span>, and <span>many</span> <span>things</span> <span>with</span> <span>this</span> <span>geart</span> <span>company</span> is still <span>around.</span><br /><br />All in all, <span>I'm</span> <span>sure</span> <span>Oracle</span> is a <span>good</span> <span>home</span> for MySQL. <span>You</span> <span>may</span> <span>think</span> <span>differently</span>, <span>but</span> I <span>am</span> <span>honored</span> <span>to</span> <span>work</span> for <span>Oracle</span>, and <span>even</span> <span>more</span> so <span>with</span> MySQL <span>at</span> <span>Oracle.</span> <span>Frankly</span>, I <span>can't</span> <span>see</span> <span>that</span> <span>it</span> <span>can</span> get <span>any</span> better.<br /><br />/Karlsson<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/9144505959002328789-2283667862031248389?l=karlssonondatabases.blogspot.com" alt="" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25197&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25197&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://karlssonondatabases.blogspot.com/2010/07/life-among-databases.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A life among databases&#8230;</title>
		<link>http://karlssonondatabases.blogspot.com/2010/07/life-among-databases.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-life-among-databases</link>
		<comments>http://karlssonondatabases.blogspot.com/2010/07/life-among-databases.html#comments</comments>
		<pubDate>Sat, 03 Jul 2010 12:44:00 +0000</pubDate>
		<dc:creator>Anders Karlsson</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-9144505959002328789.post-2283667862031248389</guid>
		<description><![CDATA[A long time ago, in the early 1980's, I decided to change jobs. I was a young guy, with no real experience of  commercial software or anything like that, rather I was a self-taught sysadmin for an ancient UNix system. The company I worked for was in the Telco business, so I looked for another job where I could develop myself and at the same to use my telco knowledge.I found a Telco startup, privately held. I must say that the fact that it was privately held meant nothing to me at the time. Nothing. They were building a system, the servers were VAXes running VMS, and again a became a sysadmin.Having been sysadmin at this company for a while, building up the central datacenter (to be honest, in todays words, that was what I was doing, but at the time, I had no real clue. I was mosr enthusiastic and ready to take on any task than I was smart or intelligent or knew what I was doing, really). But I wanted to develop myself, and at the previous job I had learnt to code in C (it was a Unix system after all), so I slowly migrated into database development, managing sysadmin duties on the side.Still, I wasn't truly professional I think. But I was willing to work and I was persistent and just wouldn't let go. I came to the office dressed in a pair of Jeans and a T-Shirt, and wasn't really aware that sometimes it would be a good idea to dress up or something (this was the 1980's still, so that might have been a good idea back then).As a developer, I realized that the system used a database, and a SQL database! I had no clue whatsoever what this was. But I started writing code creating tables and working my way through this, learning as I went. That you needed something called an "INDEX" became obvious to me after I had shown my latest creating to my colleagues and the things was just soooo slow. In the end, I actually picked up the manual for that "SQL Database", whatever THAT was.After about a year at this company, they decided to move their operations abroad, and I wanted to stay in Sweden, so I went looking for another job. The company behind the SQL Database I had used was looking for people it seemed, so I applied for a job. What it was like working for a US based software company was something I had no clue about. I got the job and turned up for my duties as a support engineer dressed in Jeans and a T-Shirt, and got to work. What a support engineer was really supposed to be doing wasn't something I really knew, it was more along the lines of people calling me with questions, and I tried to help them, as best as I could.The company in question was Oracle. And Oracle really did support me, and courage me, to develop myself, to go to training classes (I didn't ask for these, I was just sent away on them), to take on other jobs inside the organization to to develop my technical and business skills.For all this, I am grateful. Oracle largely shaped me for my future career among database companies, and if that is a good or bad thing is up for you to decide. Now I'm back at Oracle, and I still enjoy it. I am aware that not everyone will agree with me here, but I am glad to be back, after nearly 20 years after I left, and many things with this geart company is still around.All in all, I'm sure Oracle is a good home for MySQL. You may think differently, but I am honored to work for Oracle, and even more so with MySQL at Oracle. Frankly, I can't see that it can get any better./Karlsson]]></description>
			<content:encoded><![CDATA[A <span>long</span> <span>time</span> <span>ago</span>, in <span>the</span> <span>early</span> 1980's, I <span>decided</span> <span>to</span> <span>change</span> <span>jobs.</span> I <span>was</span> a <span>young</span> <span>guy</span>, <span>with</span> <span>no</span> real <span>experience</span> <span>of</span>  <span>commercial</span> <span>software</span> <span>or</span> <span>anything</span> like <span>that</span>, <span>rather</span> I <span>was</span> a <span>self-taught</span> <span>sysadmin</span> for an <span>ancient</span> <span>UNix</span> system. <span>The</span> <span>company</span> I <span>worked</span> for <span>was</span> in <span>the</span> <span>Telco</span> <span>business</span>, so I <span>looked</span> for <span>another</span> <span>job</span> <span>where</span> I <span>could</span> <span>develop</span> <span>myself</span> and <span>at</span> <span>the</span> same <span>to</span> <span>use</span> <span>my</span> <span>telco</span> <span>knowledge.</span><br /><br />I <span>found</span> a <span>Telco</span> <span>startup</span>, <span>privately</span> <span>held.</span> I must <span>say</span> <span>that</span> <span>the</span> <span>fact</span> <span>that</span> <span>it</span> <span>was</span> <span>privately</span> <span>held</span> <span>meant</span> <span>nothing</span> <span>to</span> <span>me</span> <span>at</span> <span>the</span> <span>time.</span> <span>Nothing.</span> <span>They</span> <span>were</span> <span>building</span> a system, <span>the</span> servers <span>were</span> <span>VAXes</span> <span>running</span> <span>VMS</span>, and <span>again</span> a <span>became</span> a <span>sysadmin.</span><br /><br /><span>Having</span> <span>been</span> <span>sysadmin</span> <span>at</span> <span>this</span> <span>company</span> for a <span>while</span>, <span>building</span> <span>up</span> <span>the</span> central datacenter (<span>to</span> be honest, in <span>todays</span> <span>words</span>, <span>that</span> <span>was</span> <span>what</span> I <span>was</span> <span>doing</span>, <span>but</span> <span>at</span> <span>the</span> <span>time</span>, I <span>had</span> <span>no</span> real <span>clue.</span> I <span>was</span> <span>mosr</span> <span>enthusiastic</span> and <span>ready</span> <span>to</span> <span>take</span> <span>on</span> <span>any</span> <span>task</span> <span>than</span> I <span>was</span> smart <span>or</span> intelligent <span>or</span> <span>knew</span> <span>what</span> I <span>was</span> <span>doing</span>, <span>really</span>). <span>But</span> I <span>wanted</span> <span>to</span> <span>develop</span> <span>myself</span>, and <span>at</span> <span>the</span> <span>previous</span> <span>job</span> I <span>had</span> <span>learnt</span> <span>to</span> <span>code</span> in C (<span>it</span> <span>was</span> a Unix system <span>after</span> all), so I <span>slowly</span> <span>migrated</span> <span>into</span> <span>database</span> <span>development</span>, <span>managing</span> <span>sysadmin</span> <span>duties</span> <span>on</span> <span>the</span> <span>side.</span><br /><br />Still, I <span>wasn't</span> <span>truly</span> <span>professional</span> I <span>think.</span> <span>But</span> I <span>was</span> <span>willing</span> <span>to</span> <span>work</span> and I <span>was</span> <span>persistent</span> and just <span>wouldn't</span> <span>let</span> <span>go.</span> I <span>came</span> <span>to</span> <span>the</span> <span>office</span> <span>dressed</span> in a <span>pair</span> <span>of</span> Jeans and a <span>T-Shirt</span>, and <span>wasn't</span> <span>really</span> <span>aware</span> <span>that</span> <span>sometimes</span> <span>it</span> <span>would</span> be a <span>good</span> <span>idea</span> <span>to</span> dress <span>up</span> <span>or</span> <span>something</span> (<span>this</span> <span>was</span> <span>the</span> 1980's still, so <span>that</span> <span>might</span> <span>have</span> <span>been</span> a <span>good</span> <span>idea</span> back <span>then</span>).<br /><br />As a <span>developer</span>, I <span>realized</span> <span>that</span> <span>the</span> system <span>used</span> a <span>database</span>, and a <span>SQL</span> <span>database</span>! I <span>had</span> <span>no</span> <span>clue</span> <span>whatsoever</span> <span>what</span> <span>this</span> <span>was.</span> <span>But</span> I <span>started</span> <span>writing</span> <span>code</span> <span>creating</span> <span>tables</span> and <span>working</span> <span>my</span> <span>way</span> <span>through</span> <span>this</span>, <span>learning</span> as I <span>went.</span> <span>That</span> <span>you</span> <span>needed</span> <span>something</span> <span>called</span> an "INDEX" <span>became</span> <span>obvious</span> <span>to</span> <span>me</span> <span>after</span> I <span>had</span> <span>shown</span> <span>my</span> latest <span>creating</span> <span>to</span> <span>my</span> <span>colleagues</span> and <span>the</span> <span>things</span> <span>was</span> just <span>soooo</span> <span>slow.</span> In <span>the</span> <span>end</span>, I <span>actually</span> <span>picked</span> <span>up</span> <span>the</span> manual for <span>that</span> "<span>SQL</span> <span>Database</span>", <span>whatever</span> <span>THAT</span> <span>was.</span><br /><br /><span>After</span> <span>about</span> a <span>year</span> <span>at</span> <span>this</span> <span>company</span>, <span>they</span> <span>decided</span> <span>to</span> <span>move</span> <span>their</span> operations <span>abroad</span>, and I <span>wanted</span> <span>to</span> <span>stay</span> in <span>Sweden</span>, so I <span>went</span> <span>looking</span> for <span>another</span> <span>job.</span> <span>The</span> <span>company</span> <span>behind</span> <span>the</span> <span>SQL</span> <span>Database</span> I <span>had</span> <span>used</span> <span>was</span> <span>looking</span> for <span>people</span> <span>it</span> <span>seemed</span>, so I <span>applied</span> for a <span>job.</span> <span>What</span> <span>it</span> <span>was</span> like <span>working</span> for a <span>US</span> <span>based</span> <span>software</span> <span>company</span> <span>was</span> <span>something</span> I <span>had</span> <span>no</span> <span>clue</span> <span>about.</span> I got <span>the</span> <span>job</span> and turned <span>up</span> for <span>my</span> <span>duties</span> as a support <span>engineer</span> <span>dressed</span> in Jeans and a <span>T-Shirt</span>, and got <span>to</span> <span>work.</span> <span>What</span> a support <span>engineer</span> <span>was</span> <span>really</span> <span>supposed</span> <span>to</span> be <span>doing</span> <span>wasn't</span> <span>something</span> I <span>really</span> <span>knew</span>, <span>it</span> <span>was</span> <span>more</span> <span>along</span> <span>the</span> <span>lines</span> <span>of</span> <span>people</span> <span>calling</span> <span>me</span> <span>with</span> <span>questions</span>, and I <span>tried</span> <span>to</span> <span>help</span> <span>them</span>, as best as I <span>could.</span><br /><br /><span>The</span> <span>company</span> in <span>question</span> <span>was</span> <span>Oracle.</span> And <span>Oracle</span> <span>really</span> <span>did</span> support <span>me</span>, and <span>courage</span> <span>me</span>, <span>to</span> <span>develop</span> <span>myself</span>, <span>to</span> <span>go</span> <span>to</span> <span>training</span> <span>classes</span> (I <span>didn't</span> ask for <span>these</span>, I <span>was</span> just sent <span>away</span> <span>on</span> <span>them</span>), <span>to</span> <span>take</span> <span>on</span> <span>other</span> <span>jobs</span> <span>inside</span> <span>the</span> <span>organization</span> <span>to</span> <span>to</span> <span>develop</span> <span>my</span> <span>technical</span> and <span>business</span> <span>skills.</span><br /><br />For all <span>this</span>, I <span>am</span> <span>grateful.</span> <span>Oracle</span> <span>largely</span> <span>shaped</span> <span>me</span> for <span>my</span> <span>future</span> <span>career</span> <span>among</span> <span>database</span> <span>companies</span>, and <span>if</span> <span>that</span> is a <span>good</span> <span>or</span> bad <span>thing</span> is <span>up</span> for <span>you</span> <span>to</span> <span>decide.</span> <span>Now</span> <span>I'm</span> back <span>at</span> <span>Oracle</span>, and I still <span>enjoy</span> <span>it.</span> I <span>am</span> <span>aware</span> <span>that</span> not <span>everyone</span> <span>will</span> <span>agree</span> <span>with</span> <span>me</span> <span>here</span>, <span>but</span> I <span>am</span> glad <span>to</span> be back, <span>after</span> <span>nearly</span> 20 <span>years</span> <span>after</span> I <span>left</span>, and <span>many</span> <span>things</span> <span>with</span> <span>this</span> <span>geart</span> <span>company</span> is still <span>around.</span><br /><br />All in all, <span>I'm</span> <span>sure</span> <span>Oracle</span> is a <span>good</span> <span>home</span> for MySQL. <span>You</span> <span>may</span> <span>think</span> <span>differently</span>, <span>but</span> I <span>am</span> <span>honored</span> <span>to</span> <span>work</span> for <span>Oracle</span>, and <span>even</span> <span>more</span> so <span>with</span> MySQL <span>at</span> <span>Oracle.</span> <span>Frankly</span>, I <span>can't</span> <span>see</span> <span>that</span> <span>it</span> <span>can</span> get <span>any</span> better.<br /><br />/Karlsson<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/9144505959002328789-2283667862031248389?l=karlssonondatabases.blogspot.com" alt="" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25197&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25197&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://karlssonondatabases.blogspot.com/2010/07/life-among-databases.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
