<?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>The Pythian Blog &#187; Gerry Narvaja</title>
	<atom:link href="http://www.pythian.com/news/author/gnarvaja/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pythian.com/news</link>
	<description>News and views from Pythian DBAs</description>
	<lastBuildDate>Fri, 19 Mar 2010 20:07:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Gerry Narvaja: the Winds Of Change</title>
		<link>http://www.pythian.com/news/4781/gerry-narvaja-winds-of-change/</link>
		<comments>http://www.pythian.com/news/4781/gerry-narvaja-winds-of-change/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 18:33:46 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[Job Openings at Pythian]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Non-Tech Articles]]></category>
		<category><![CDATA[Pythian]]></category>
		<category><![CDATA[Andrew Waitman]]></category>
		<category><![CDATA[Augusto Bott]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[dba]]></category>
		<category><![CDATA[Gerry Narvaja]]></category>
		<category><![CDATA[mysql community]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[paul vallee]]></category>
		<category><![CDATA[Sheeri Cabral]]></category>
		<category><![CDATA[trends]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=4781</guid>
		<description><![CDATA[For very personal reasons that don&#8217;t belong in this article, I decided a few weeks ago that it&#8217;s time for me to move on. The year and a half that I worked for Pythian have been a wonderful experience, and this is article is my tribute to this great company.
The MySQL Team
Being able to work [...]]]></description>
			<content:encoded><![CDATA[<p>For very personal reasons that don&#8217;t belong in this article, I decided a few weeks ago that it&#8217;s time for me to move on. The year and a half that I worked for <strong>Pythian</strong> have been a wonderful experience, and this is article is my tribute to this great company.</p>
<h3>The MySQL Team</h3>
<p>Being able to work side by side with two MySQL experts like <a id="bkl7" title="Sheeri Cabral" href="/news/author/sheeri/">Sheeri Cabral</a> and <a id="oyvi" title="Augusto Bott" href="/news/author/bott/">Augusto Bott</a> has been a great experience. I have learned a lot, not only about MySQL, but also about what a great DBA should be like. Both of them are recognized MySQL Community members and regular speakers at the MySQL Users Conference and other events. Sheeri has been named MySQL Community Member of the Year twice in a row. Both are a guarantee of excellent service.</p>
<h3>My Predictions For Pythian</h3>
<p><span id="more-4781"></span><br />
I believe that the IT services industry will undergo a change that is continuation of the the transformation that the IT industry as a whole has been going through over the last few years: <strong>commoditization</strong>.</p>
<p>Very few will argue at this point that hardware and software are commodities, especially when they support a company&#8217;s infrastructure. This trend has put MySQL in the position it has today in the database arena. In this scenario, managing the IT infrastructure, whether it&#8217;s running in <em>The Cloud</em>, a hosting company or internally, no longer adds value to the core business. As in any economic downturn, companies reconsider their overhead and look for solutions that are more flexible and cost-effective that their in-house services. This is when they start looking into outsourcing alternatives.</p>
<p>This time, however,  is different&#8212;they have a designated fixed budget and very specific needs. The traditional consulting model doesn&#8217;t fit this scenario since it doesn&#8217;t have the required flexibility. This is where companies like Pythian come in.</p>
<p>Pythian&#8217;s business model and practices allows the clients to control their budgets while keeping a healthy infrastructure, and concentrating on the tasks that add real value to their business. Under the direction of <strong>Andrew Waitman</strong>, CEO, and <strong>Paul Vallée</strong>, Pythian&#8217;s founder, the company is in a an excellent position to satisfy the new market needs.</p>
<h3>What&#8217;s Next</h3>
<p>I will continue participating as actively as I can in the MySQL Community and continue with the development of <strong>sar-mysql</strong>. My blogs will move to a new home, but will be a continuation of the of the articles I have been writing here (without <a id="du1d" title="Dave Edwards" href="/news/author/edwards/">Dave Edwards</a> cleaning up my English though); and they will also be syndicated in <a id="x9-d" title="Planet MySQL" href="http://planet.mysql.com/">Planet MySQL</a>. I will do my best to keep an eye on the articles I posted in the Pythian blog to keep answering any new comments that may be posted there. If you have the patience to deal with my non-technical tweets, feel free to follow me through Twitter: <a id="c6wt" title="@seattlegaucho" href="http://twitter.com/seattlegaucho">@seattlegaucho</a>.</p>
<p>I will see you around!</p>
<p><strong>P.S. to the MySQL DBAs in the wild</strong>: This might be a good opportunity to polish your résumé and submit it to Pythian. Who knows, you may end up working for a company on the rise, side-by-side with some of the best MySQL DBAs in the market.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/4781/gerry-narvaja-winds-of-change/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>sar-sql: The Script Formerly Known as MySAR</title>
		<link>http://www.pythian.com/news/4703/sar-sql-the-script-formerly-known-as-mysar/</link>
		<comments>http://www.pythian.com/news/4703/sar-sql-the-script-formerly-known-as-mysar/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 19:47:41 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Technical Blog]]></category>
		<category><![CDATA[MySAR]]></category>
		<category><![CDATA[opensql]]></category>
		<category><![CDATA[opensql camp]]></category>
		<category><![CDATA[opensqlcamp]]></category>
		<category><![CDATA[Pythian]]></category>
		<category><![CDATA[sar-sql]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=4703</guid>
		<description><![CDATA[As pointed out by Schlomi Noach on my last blog, MySAR was already taken by a project related to Squid reports with MySQL. I decided then to look for a new name, and as I posted initially, I want to keep the sar prefix to describe the script&#8217;s purpose by association with the OS utility [...]]]></description>
			<content:encoded><![CDATA[<p>As pointed out by <a href="http://code.openark.org/"><strong>Schlomi Noach</strong></a> on my last blog, <a href="http://giannis.stoilis.gr/software/mysar/"><strong>MySAR</strong></a> was already taken by a project related to Squid reports with MySQL. I decided then to look for a new name, and as I posted initially, I want to keep the <em>sar</em> prefix to describe the script&#8217;s purpose by association with the OS utility of the same name. I brainstormed many names. I liked <strong>Dave Edwards&#8217;s</strong> suggestion: <em>SARkila</em>, but it sounds too close to <em>tequila</em>, so I settled with <strong>Sheeri Cabral&#8217;s</strong> suggestion: <em>sar-sql</em>. </p>
<p>The title of the Launchpad page already reflects the change. What remains to be done is: a) change the name of the Perl script and documentation; and b) change the Launchpad URL. It is likely that I will change the name of the script when I release version 1.x (see below). I&#8217;m not sure of all the implications in Bazaar regarding the URL change, so that task will have to wait for now.</p>
<p>Now a little more info on the status of the project. <span id="more-4703"></span></p>
<h3>Bug Fixes</h3>
<p>In the latest trunk there are two patches. One corresponds to <a id="bs4a" title="Bug #455870" href="https://bugs.launchpad.net/mysar/+bug/455870">Bug #455870</a>, which should be fixed. I&#8217;m excited since this bug was posted by a user. (Yay!)</p>
<p>The 2nd patch refers to a bug that came up during an implementation in a client, in a master-slave configuration (in hindsight, I should have thought about it earlier). The snapshots from the master were being replicated to the slave, so when the script ran on the slave, the autoincrement values were in conflict and stopped replication. In the latest patch (build 16), I have added a column that records the server id, as in <code>SHOW GLOBAL VARIABLES LIKE 'server_id' </code> to distinguish the master and slave data. I like the fact that it is possible to query the master and slave snapshots side by side to diagnose slave lag. This change makes the last version in the trunk incompatible with the newer ones, which triggered the creation of the first README file.</p>
<p>I will be posting a new tarball soon.</p>
<h3>Road Map</h3>
<p>Believe or not, there are enough ideas in the queue to justify a road map. Here&#8217;s a summary list and you&#8217;re welcome to comment on it. I promise to review all the suggestions.</p>
<h4>Code Review</h4>
<p>As I mentioned above, the script currently works, but it&#8217;s far from optimal. So I&#8217;ll be changing the code base with two objectives. 1) Increase overall efficiency; and 2) facilitate future improvements. The more profound code changes will be implemented in version 0.x (current version). I believe that messy code leads to bugs, so the cleaner it is, the less likely I&#8217;ll break existing functionality while adding new one.</p>
<h4>Command Line Syntax Changes</h4>
<p>Adding new functionality implies that the script will perform more tasks which in turn will add overhead to each one of them. To minimize this overhead, I am working on a different command line syntax and the corresponding underlying code. This change will happen in version 1.x (the next version) since the code has to be cleaned up to be effective and works as it is. The command line syntax change will imply rewriting any wrapper script that might be in place to invoke in the crontab, so this will be the opportunity to rename the script as well.</p>
<h4>Installer</h4>
<p>The script is so simple that distributing a tarball is enough for now, but I&#8217;d like to have an installer and possibly a package that will take care of the Perl modules dependencies, schema initialization and user credentials verification / creation. I have no target version for this. I&#8217;ll shoot for 1.x, but it&#8217;s likely to go into 2.x.</p>
<h4>Other</h4>
<p>I&#8217;m still working on plenty of use cases, best practices, and companion scripts examples. In time, the example scripts and documentation will be part of the complete package and installed along side with the main utility. In the meantime, just follow the blogs and the links to them in the Launchpad announcements page.</p>
<h3>Community Participation</h3>
<p>Having a user file a bug, <strong>Schlomi&#8217;s</strong> bringing up the name issue, and <strong>Sheeri</strong> contributing with her sanity checks are a great help, but I invite all of you out there to participate through comments to my blogs, bug reports, questions in the Launchpad page, and replying to my tweets.</p>
<p>I will be participating in <a id="b.xy" title="OpenSQL Camp" href="http://www.opensqlcamp.org/Main_Page">OpenSQL Camp</a> in Portland, OR next month. I&#8217;m sure I will have an opportunity to review my ideas with the old friends I&#8217;ll be meeting there. Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/4703/sar-sql-the-script-formerly-known-as-mysar/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Log Buffer #166: a Carnival of the Vanities for DBAs</title>
		<link>http://www.pythian.com/news/4627/log-buffer-166-a-carnival-of-the-vanities-for-dbas/</link>
		<comments>http://www.pythian.com/news/4627/log-buffer-166-a-carnival-of-the-vanities-for-dbas/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 18:21:33 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[Log Buffer]]></category>
		<category><![CDATA[Non-Tech Articles]]></category>
		<category><![CDATA[Technical Blog]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql community]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Pythian]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=4627</guid>
		<description><![CDATA[This week the Log Buffer is a little more challenging for two reasons: a) Oracle Open World 2009 and b) the controversy around Monty Widenius&#8216; opposition to  Oracle owning MySQL due to the Sun acquisition, so let&#8217;s go straight to the articles.
Oracle &#8211; Oracle Open World 2009
There is so much material about OOW09, that [...]]]></description>
			<content:encoded><![CDATA[<p>This week the <a href="/news/about-log-buffer"><em>Log Buffer</em></a> is a little more challenging for two reasons: a) <strong>Oracle Open World 2009</strong> and b) the controversy around <strong>Monty Widenius</strong>&#8216; opposition to  <strong>Oracle</strong> owning <strong>MySQL</strong> due to the <strong>Sun</strong> acquisition, so let&#8217;s go straight to the articles.</p>
<h3>Oracle &#8211; Oracle Open World 2009</h3>
<p>There is so much material about <strong>OOW09</strong>, that I&#8217;m giving a full subtitle to it.</p>
<p>Let&#8217;s start with a quick recap of the keynotes by <strong>Scott McNealy</strong> and <strong>Larry Elison</strong> in this article by <strong>Andrew Clarke</strong>: <a title="The return of The Scott And Larry Show" href="http://radiofreetooting.blogspot.com/2009/10/return-of-scott-and-larry-show.html">The return of The Scott And Larry Show</a>. The recap suggests that the presentations aimed to show how <strong>Sun &amp; Oracle</strong> (aka Team Red) would challenge <strong>IBM</strong> (aka Big Blue) head-on. Larry didn&#8217;t fail to mention Oracle&#8217;s intention to invest in <strong>MySQL</strong>.</p>
<p>Of course the conference wasn&#8217;t short on technical issues, and these articles prove it. <strong>Jason Arneil</strong> talks about <a title="11 Things about 11gR2" href="http://jarneil.wordpress.com/2009/10/14/oracle-openworld-11-things-about-11gr2/">11 Things about 11gR2</a>. <strong>Chen Shapira</strong> discusses one of the lessons she learned, and shares with us some <a title="Shell Script Tips" href="http://prodlife.wordpress.com/2009/10/17/lessons-from-oow09-1-shell-script-tips/">Shell Script Tips</a>.</p>
<p><span id="more-4627"></span></p>
<p>Apparently one of the most exciting event was the <strong>Bloggers&#8217; Meetup</strong>, and <strong>Pythian</strong>&#8217;s T-shirts&#8212;which had to be signed by the attendees to win a netbook&#8212;were a great success. You can read all about it in <strong><span>Doug Burns&#8217;s</span></strong> article <a title="OOW 2009 - Blogger's Meetup" href="http://oracledoug.com/serendipity/index.php?/archives/1531-OOW-2009-Bloggers-Meetup.html">OOW 2009 &#8211; Blogger&#8217;s Meetup</a> (don&#8217;t miss the links at the bottom for more of his articles); and in <strong>Richard Foote</strong>&#8217;s  <a title="Day 3 Highlights" href="http://richardfoote.wordpress.com/2009/10/15/oracle-openworld-2009-day-3-highlights/">Day 3 Highlights</a>. And of course our own <strong>Alex Gorbachev&#8217;s</strong> blog  <a title="Pythian OOW09 Diaries: Bloggers Meetup" href="../4523/pythian-oow09-diaries-bloggers-meetup">Pythian OOW09 Diaries: Bloggers Meetup</a> with plenty of pictures.</p>
<p>Last but not least is  <strong>Oracle Magazine&#8217;s</strong>  <a title="DBA of the Year" href="http://husnusensoy.wordpress.com/2009/10/15/dba-of-the-year/">DBA of the Year</a>: <strong>Husnu Sensoy</strong>. Congratulations from the folks at Pythian, Hunsu!</p>
<h3>Oracle</h3>
<p>Let&#8217;s start with <strong>Chris Foot&#8217;s</strong> <a id="rw1o" title="The Art of Being a Successful DBA – Finding Information Quickly" href="http://www.remotedbaexperts.com/Blog/2009/10/the-art-of-being-a-successful-dba-finding-information-quickly/">The Art of Being a Successful DBA – Finding Information Quickly</a>. </p>
<p>I agree 100% with all Chris&#8217;s criteria, so here are my links for the MySQL DBAs: 1) <a id="t36b" title="Planet MySQL" href="http://planet.mysql.com/">Planet MySQL</a> or it&#8217;s Twitter counterpart <a id="wq6g" title="@mysql_community" href="http://twitter.com/mysql_community">@mysql_community</a>, 2) <a id="r4qr" title="MySQL online documentation" href="http://dev.mysql.com/doc/index.html">MySQL online documentation</a> (remember to <em>read the manuals</em>), 3) <a id="w7sw" title="MySQL Forums" href="http://forums.mysql.com/">MySQL Forums</a> &amp; 4) Twitter&#8217;s <a id="dw7b" title="#mysql RSS feed" href="http://search.twitter.com/search.atom?q=%23mysql">#mysql RSS feed</a>. I have more resources bookmarked, but these are a great starting point. <strong>Jonathan Lewis&#8217;s</strong> article <a title="Experts" href="http://jonathanlewis.wordpress.com/2009/10/18/experts/">Experts</a> is somewhat related and has great advice as well.</p>
<p>How many DBAs face the question of recovering data that has been accidentally deleted? <strong>Luis Moreno Campos</strong> presents  <a title="Reversing the effect of a TRUNCATE TABLE in Oracle 11gR2" href="http://ocpdba.wordpress.com/2009/10/19/reversing-the-effect-of-a-truncate-table-in-oracle-11gr2/">Reversing the effect of a TRUNCATE TABLE in Oracle 11gR2</a>. And still on typical DBAs&#8217; tasks, we also have articles by <strong>Richard Foote</strong>: <a title="How To Rebuild And Make An Index Bigger, Not Smaller (Carry That Weight)" href="http://richardfoote.wordpress.com/2009/01/13/how-to-rebuild-and-make-an-index-bigger-not-smaller-carry-that-weight/">How To Rebuild And Make An Index Bigger, Not Smaller (Carry That Weight)</a>, <strong>Miladin Modrakovic&#8217;s</strong> <a title="Blocking locks history" href="http://oraclue.com/2009/10/15/blocking-locks-history/">Blocking locks history</a>, <strong>Marco Gralike&#8217;s</strong> <a title="HOWTO: Partition Binary XML, XMLType Storage" href="http://www.liberidu.com/blog/?p=1415">HOWTO: Partition Binary XML, XMLType Storage</a> and <strong>Slavik Markovich&#8217;s</strong> important recommendation on security <a title="Blind SQL Injection in Oracle" href="http://www.slaviks-blog.com/2009/10/13/blind-sql-injection-in-oracle/">Blind SQL Injection in Oracle</a>. The latter one has Oracle in the title, but I believe the concepts he discusses can be applied to any database.</p>
<h3>MySQL &#8230; Or Should That Be Oracle?</h3>
<p><strong>Monty Widenius</strong>, one of the three founders and creators of <strong>MySQL</strong> wrote an interesting <a title="Press release concerning Oracle/Sun" href="http://monty-says.blogspot.com/2009/10/press-release-concerning-oraclesun.html">press release concerning Oracle/Sun</a> explaining why he believes that the European Unionconcerns about Oracle owning MySQL are justified. This created quite a stir in the MySQL community, with many people writing their own open letters, recommendations, and editorials on the matter. </p>
<p><strong>Zak Greant&#8217;s</strong> <a title="Letter to the EC on the Oracle/Sun Takeover" href="http://zak.greant.com/oracle-sun-and-the-ec/">Letter to the EC on the Oracle/Sun Takeover</a>, <strong>Lukas Kahwe Smith&#8217;s</strong> <a title="MySQL needs to be saved from Oracle?" href="http://pooteeweet.org/blog/0/1554#m1554">MySQL needs to be saved from Oracle?</a> and <strong>Brian Aker&#8217;s</strong> <a id="biqh" title="RMS, GPL, The Peculiar Institution of Dual Licensing" href="http://krow.livejournal.com/673195.html">RMS, GPL, The Peculiar Institution of Dual Licensing</a> are just a sample of what&#8217;s out there. If you are interested in the subject, I recommend you browse the articles in <a href="http://planetmysql.org">Planet MySQL</a>.</p>
<p>In my opinion, I don&#8217;t believe that the community and customers should be concerned&#8212;there are enough companies in the ecosystem with MySQL branches and and/or providing services, that any Oracle action to de-activate or damage MySQL would be pointless. The only companies that could be affected, are those who use MySQL embedded in products which are not released under GPL (OEM customers). These companies hold commercial licenses, but could still open their software under GPL or compatible licenses and concentrate in their core values to avoid any issues that Oracle may cause.</p>
<h3>MySQL</h3>
<p>To finish on a high note, I&#8217;d like to highlight a few good MySQL-related articles that I came accross while preparing this blog.</p>
<p><strong>Percona</strong> has published two good articles that help us to understand some of the decisions that a typical MySQL DBA has to face sooner or later. The first article describes when storing the data in the DB might not be a good idea and <strong>memcached</strong> would, in <a title="MySQL-Memcached or NOSQL Tokyo Tyrant – part 1" href="http://www.mysqlperformanceblog.com/2009/10/15/mysql-memcached-or-nosql-tokyo-tyrant-part-1/">MySQL-Memcached or NOSQL Tokyo Tyrant – part 1</a>. The other article discusses different High Availability strategies to use with MySQL in <a title="Finding your MySQL High-Availability solution – The questions" href="http://www.mysqlperformanceblog.com/2009/10/16/finding-your-mysql-high-availability-solution-%E2%80%93-the-questions/">Finding your MySQL High-Availability solution – The questions</a> with plenty of comments. <strong>Kris Buyaert</strong> decided to comment on the article in a blog of his own: <a title="Nines , Damn Nines and More Nines" href="http://www.krisbuytaert.be/blog/nines-damn-nines-and-more-nines">Nines , Damn Nines and More Nines</a>.</p>
<p>Finally, <strong>Lenz Grimmer</strong> invites us to submit talks for <strong>FOSDEM 2010</strong> in Brussels, Belgium: <a title="FOSDEM Call For Participation opened - submit your talks now!" href="http://www.lenzg.net/archives/280-FOSDEM-Call-For-Participation-opened-submit-your-talks-now%21.html">FOSDEM Call For Participation opened &#8211; submit your talks now!</a>. This might be a good excuse to visit Europe.</p>
<p>I hope the <strong>SQL Server</strong> folks don&#8217;t feel dissapointed that we left them out on this edition, but <strong>Oracle Open World</strong> and <strong>Monty</strong>&#8217;s press release gave us too much material to sift through. I&#8217;m sure <strong>Dave</strong> will come up with plenty of cool highlights for you on the next edition of the <em>Log Buffer</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/4627/log-buffer-166-a-carnival-of-the-vanities-for-dbas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySAR, a Sidekick for Other Monitoring Tools</title>
		<link>http://www.pythian.com/news/4577/mysar-a-sidekick-for-other-monitoring-tools/</link>
		<comments>http://www.pythian.com/news/4577/mysar-a-sidekick-for-other-monitoring-tools/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 19:23:17 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Google Charts]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[MySAR]]></category>
		<category><![CDATA[mysql status]]></category>
		<category><![CDATA[Pythian]]></category>
		<category><![CDATA[Schlomi Noach]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=4577</guid>
		<description><![CDATA[I&#8217;m sure that most people have at least one of the tools listed in Ronald Bradford&#8217;s article: Monitoring MySQL Options. Many of these tools, such as Nagios and Cacti, also monitor the operating system. However, in the same way that a quick look at sar&#8217;s output can give you some insight on the OS, with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure that most people have at least one of the tools listed in <strong>Ronald Bradford&#8217;s</strong> article: <a href="http://ronaldbradford.com/blog/monitoring-mysql-option-2009-10-15/">Monitoring MySQL Options</a>. Many of these tools, such as Nagios and Cacti, also monitor the operating system. However, in the same way that a quick look at <strong>sar</strong>&#8217;s output can give you some insight on the OS, with <a href="http://launchpad.net/mysar"><strong>MySAR</strong></a> you can do the same for the MySQL server. This is especially useful when  it is not possible to access a monitoring tool&#8217;s graphic interfaces.</p>
<h3>What Was Going On Around 2:30pm?</h3>
<p>This is a question a customer asked us. To answer it we ran MySAR for a few days and queried the results for analysis. Looking at the data, we determined that the number of <code>INSERT</code> operations was significantly higher than any other, so we queried for the <code>Com_insert</code> status values.  <code>Com_insert</code> is a counter that accumulates the number of <code>INSERT</code>s issued since the last server start (or since the last FLUSH STATUS command). For details on the variables available check <a href="http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-optvar.html">Chapter 1. mysqld Options/Variables Reference</a>. </p>
<p>The initial query we used was:  <span id="more-4577"></span></p>
<pre>select value_stat_name name, value_stat_timestamp ti, value_stat_number val, value_stat_delta delta from value_stat
where value_stat_name like "Com_insert"
and HOUR(value_stat_timestamp) between 13 and 15
and date(value_stat_timestamp) between "2009-08-22" and "2009-08-25"
order by 1, 2
+------------+---------------------+-----------+-------+
| name       | ti                  | val       | delta |
+------------+---------------------+-----------+-------+
| Com_insert | 2009-08-22 13:00:01 | 163777289 | 16051 |
| Com_insert | 2009-08-22 13:10:01 | 163794262 | 16973 |
| Com_insert | 2009-08-22 13:20:01 | 163810327 | 16065 |
| Com_insert | 2009-08-22 13:30:01 | 163826242 | 15915 |
....
| Com_insert | 2009-08-25 15:20:01 | 168362221 | 13835 |
| Com_insert | 2009-08-25 15:30:01 | 168376888 | 14667 |
| Com_insert | 2009-08-25 15:40:01 | 168392410 | 15522 |
| Com_insert | 2009-08-25 15:50:02 | 168408476 | 16066 |
+------------+---------------------+-----------+-------+
72 rows in set (1.56 sec)</pre>
<p>72 rows of numbers are not very easy to interpret, so the next step was to create a graphic to visualize the results. Taking the ideas from <strong>Shlomi Noach&#8217;s</strong> blog, <a href="http://code.openark.org/blog/mysql/sql-pie-chart">SQL pie chart</a>, I decided to try and create the charts using the <a href="http://code.google.com/apis/chart/">Google Charts API</a>.</p>
<h3>Easy Graphics How-To</h3>
<p>The first step was to create the string of values needed for the chart. I achieved this using <code>GROUP_CONCAT</code>, adding some formulas to scale the values properly:</p>
<pre>select day(value_stat_timestamp) as day,
GROUP_CONCAT((value_stat_delta-12000)/70) as series from value_stat
where value_stat_name like "Com_insert" and HOUR(value_stat_timestamp) between 13 and 15
and date(value_stat_timestamp) between "2009-08-22" and "2009-08-25"
group by day(value_stat_timestamp);
+------+------------------------------------------------------------------------------------------
| day  | series
+------+-----------------------------------------------------------------------------------
|   22 | 57.8714,80.3000,81.2571,94.3857,85.2571,66.0857,94.6429,74.2857,91.1000,...
|   23 | 74.4857,95.5857,103.4571,101.3000,75.9429,75.3571,79.3000,83.0571,94.7714,...
|   24 | 25.6286,38.8429,31.7000,36.3857,50.0143,44.3286,46.1571,39.4714,34.3857,21.5571,...
|   25 | 6.8000,12.9714,33.0429,13.8286,26.2143,38.1000,50.3143,19.4429,13.0857,3.2143,7.9143,...
+------+------------------------------------------------------------------------------------------
4 rows in set (0.34 sec)</pre>
<p>(To make the output more readable, I&#8217;m not including the whole lines.) Using the values corresponding day <strong>22</strong>, the most simple line graphic can be created with following HTML tag:</p>
<pre>&lt;img src="http://chart.apis.google.com/chart?cht=lc&amp;chs=400x200&amp;
chd=t:57.8714,80.3000,81.2571,94.3857,85.2571,66.0857,94.6429"&gt;</pre>
<p>Resulting in:</p>
<p><img src="http://chart.apis.google.com/chart?cht=lc&amp;chs=400x200&amp;chd=t:57.8714,80.3000,81.2571,94.3857,85.2571,66.0857,94.6429" alt="Simple Chart" /></p>
<p>In the URL string, <strong>cht</strong>, <strong>chs</strong>, and <strong>chd</strong> represent <em>chart type</em>, <em>chart size</em>, and <em>chart data</em> respectively; you can check the details in the Google Chart API URL I quoted above.</p>
<p>You can copy and paste the &lt;img&gt; tag above into an HTML document (no need to add any text) and open it with any browser. For Firefox, the URL to open a file on disk would look similar to this:</p>
<pre>file:///path/to/file/file_name.html</pre>
<p>Go ahead, open any text editor, copy and paste the example above in any file, save it with extension <strong>.html</strong> and open it with your browser.</p>
<p>The chart with the complete data set and and some decorations looks like this&#8212;each color represents a different day from the dataset above:</p>
<pre><img src="http://chart.apis.google.com/chart?chs=400x200&amp;chd=t:57.8714,80.3000,81.2571,94.3857,85.2571,66.0857,94.6429,74.2857,91.1000,68.4857,82.7143,71.0429,58.0714,55.9286,82.3571,64.5571,74.2429,86.5286%7C74.4857,95.5857,103.4571,101.3000,75.9429,75.3571,79.3000,83.0571,94.7714,63.0857,68.7571,70.2857,64.0000,66.3714,66.9429,53.5143,88.5000,76.8286%7C25.6286,38.8429,31.7000,36.3857,50.0143,44.3286,46.1571,39.4714,34.3857,21.5571,11.6286,25.0857,16.1143,22.7143,17.4714,34.0571,24.3286,23.9571%7C6.8000,12.9714,33.0429,13.8286,26.2143,38.1000,50.3143,19.4429,13.0857,3.2143,7.9143,1.9857,9.7571,5.4000,1.9857,8.1286,4.0571,58.0857&amp;cht=lc&amp;chl=13:00%7C14:00%7C15:00%7C16:00&amp;chco=ff0000,00ff00,0000ff,000000" alt="Complete Chart" /></pre>
<p>Using the function <code>CONCAT</code>,  it is possible to create the complete &lt;img src=&#8221;&#8230;&#8221;&gt; tag directly from the SQL statement by adding the proper sub-strings.</p>
<h3>Conclusion</h3>
<p>Using <strong>MySAR</strong>, it is possible to  to collect the data, query the data for diagnosis. and create graphics to visualize those values.</p>
<p>By the way, there was nothing significant happening in the database at 2:30pm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/4577/mysar-a-sidekick-for-other-monitoring-tools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MySAR: A sar-like Utility for MySQL</title>
		<link>http://www.pythian.com/news/4230/mysar-a-sar-like-utility-for-mysql/</link>
		<comments>http://www.pythian.com/news/4230/mysar-a-sar-like-utility-for-mysql/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 18:48:17 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Technical Blog]]></category>
		<category><![CDATA[Bazaar]]></category>
		<category><![CDATA[Launchpad]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[MySAR]]></category>
		<category><![CDATA[mysql status]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Pythian]]></category>
		<category><![CDATA[sar]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=4230</guid>
		<description><![CDATA[Why a New Utility?
A couple of months back, Tim Procter, Sheeri Cabral and I were discussing about how best to diagnose a MySQL server and/or tune its performance, automating the process as much as possible. The Performance Advisors from MySQL Enterprise do this, but most of our customers don&#8217;t have a subscription and Pythian&#8217;s collective [...]]]></description>
			<content:encoded><![CDATA[<h3>Why a New Utility?</h3>
<p>A couple of months back, <a href="http://www.pythian.com/news/author/admin">Tim Procter</a>, <a href="http://www.pythian.com/news/author/sheeri/">Sheeri Cabral</a> and I were discussing about how best to diagnose a MySQL server and/or tune its performance, automating the process as much as possible. The <strong>Performance Advisors</strong> from <a href="http://www.mysql.com/products/enterprise/">MySQL Enterprise</a> do this, but most of our customers don&#8217;t have a subscription and Pythian&#8217;s collective experience is not necessary reflected by its rules.</p>
<p>In our daily work, we have used <a href="http://blog.mysqltuner.com/">Major Heyden&#8217;s MySQL Tuner</a>, <a href="http://www.markleith.co.uk/?p=21">Mark Leith&#8217;s Statpack</a> and  our own tools to review a MySQL server configuration parameters. However, all of these tools had limitations in regards of what we wanted to achieve. Our major concern was the need to keep historical data to draw conclusions based on trends and cross check with other time based tools. The conclusion of our conversations was that whatever scripts we would implement, it would need to monitor all configuration and status variables, and their evolution over time.</p>
<p>One day, while looking into slave lag problem, the idea of MySAR popped into my head and a few hours later I was using its first incarnation. I was able to relate the server&#8217;s I/O activity peaks with these lags and in turn, discovered that it was caused by a great number of <code>INSERT</code> statements coming in in waves. It was an encouraging outcome for what was nothing more than a proof of concept.</p>
<p><span id="more-4230"></span></p>
<h3>MySAR&#8217;s Goal</h3>
<p>Major Heyden&#8217;s MySQL Tuner, Mark Leith&#8217;s Statpack, and our own scripts already do analysis and recommendations.  Not wishing to reinvent the wheel, I decided that the best thing to do was to gather as much data as possible and store it in the database, from which it can be extracted to perform any kind of manipulations. My intention, then, is, to limit MySAR to be just a sampling tool. In short, to <em>keep it simple</em>.</p>
<h3>What Does MySAR Do?</h3>
<p>MySAR does nothing else than record the output of <code>SHOW GLOBAL STATUS</code>, <code>SHOW GLOBAL VARIABLES</code>, and <code>SHOW FULL PROCESSLIST</code> commands &#8212; or a configurable subset of their output. The idea is to invoke MySAR from the <em>crontab</em> (or similar tool on Windows) at regular intervals. Data older than 30 days is purged by default to avoid accumulating too much data on disk. We usually run it every ten minutes so it will be roughly in sync with sar&#8217;s output.</p>
<h3>Where to Get MySAR and Submit Feedback</h3>
<p>I have decided to use <strong>Bazaar</strong> and <strong>Launchpad</strong> to track the project: <a href="http://launchpad.net/mysar">http://launchpad.net/mysar</a>. I found it to be the most convenient alternative. Consider the code to be in the <em>alpha</em> stage&#8212;not necessarily feature-complete and with bugs. The <em>trunk</em> branch has the most stable version (the current <em>development</em> branch has been merged into the trunk).  But if you just want the latest public tarball, you can use the <a href="http://launchpad.net/mysar/trunk/make-alpha-0-public/+download/mysar.tar.gz">download link</a> in the project Launchpad page.</p>
<h3>Documentation</H3></p>
<p>The documentation is provided in plain text, HTML, and perldoc formats (<code>perldoc mysar.pl</code>) as part of the tarball. It is complete since I use it as a specification document and gets written before the code is complete. You can <a href="http://bazaar.launchpad.net/%7Egnarvaja/mysar/trunk/annotate/head%3A/manual.html">download the HTML manual</A> (click the &#8220;download this file&#8221; link on that page).</p>
<p>Please record bugs, questions, suggestions in the appropriate sections of the launchpad site and I&#8217;ll address them as best I can. I invite the community at large to contribute with use cases and examples in the <strong>Answers</strong> section, and I&#8217;ll post the most creative contributions as FAQs (along with the real FAQs). I don&#8217;t expect too much in the beginning. Hopefully the contributions will start coming in once it proves as useful as it has been for us so far.</p>
<h3>Installation</h3>
<p>At this point the requirement are only the <strong>DBI</strong> and <strong> DBI::mysql</strong> Perl modules. To install follow these steps:</p>
<ol>
<li>Download the latest tarball from the <a href="http://launchpad.net/mysar/trunk/make-alpha-0-public/+download/mysar.tar.gz">download link</a> on the Launchpad page.</li>
<li>Untar on any subdirectory using:
<pre>tar -xzf mysar.tar.gz</pre>
</li>
<li>Create a schema to hold it&#8217;s tables (or use an existing schema with the <strong>&#8211;database</strong> option). The default schema name is <strong>mysar</strong>. Example:
<pre> CREATE DATABASE mysar;</pre>
</li>
<li>Make sure the user already exists and has full access to this schema. Example to grant the permissions:
<pre>GRANT ALL ON mysar.* TO 'username'@'localhost'</pre>
</li>
<li>Run at least once to create the tables. The mimimum command line required is:
<pre>mysar --user username --pass password --status / variables</pre>
<p>Either <strong>&#8211;status </strong>or <strong>&#8211;variables</strong> should be used. Currently there is a bug (Launchpad&#8217;s <a href="https://bugs.launchpad.net/mysar/+bug/441006">bug #441006</a>) when you run with <strong>&#8211;status</strong> for the first time, which can be safely ignored.</li>
</ol>
<p>I will be blogging different use cases based on real cases in the near future, including how to easily draw colorful graphics using the <a href="http://code.google.com/apis/chart/">Google Charts API</a>, so stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/4230/mysar-a-sar-like-utility-for-mysql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Log Buffer #161: a Carnival of the Vanities for DBAs</title>
		<link>http://www.pythian.com/news/3949/log-buffer-161-a-carnival-of-the-vanities-for-dbas/</link>
		<comments>http://www.pythian.com/news/3949/log-buffer-161-a-carnival-of-the-vanities-for-dbas/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 17:41:35 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[Log Buffer]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Non-Tech Articles]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Pythian]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3949</guid>
		<description><![CDATA[Welcome to the 161st edition of Log Buffer, the weekly review of database blogs &#8230; and the first one under my penmanship.
MySQL
Johan Andersson explains in a very simple way the scenarios in which you may fall into a split brain situation and how to avoid it in MySQL Cluster on two hosts &#8211; options and [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to the 161<sup>st</sup> edition of <a href="http://www.pythian.com/news/about-log-buffer"><em>Log Buffer</em></a>, the weekly review of database blogs &#8230; and the first one under my penmanship.</p>
<h3>MySQL</h3>
<p><a href="http://johanandersson.blogspot.com"><strong>Johan Andersson</strong></a> explains in a very simple way the scenarios in which you may fall into a <em>split brain</em> situation and how to avoid it in <a href="http://johanandersson.blogspot.com/2009/09/mysql-cluster-on-two-hosts-options-and.html">MySQL Cluster on two hosts &#8211; options and implications</a>. An article worth reading from one of the MySQL Cluster experts.</p>
<p>I love simple scripts that solve complex problems. I love it even more when the command line can be defined in an <em>alias</em>, and  <a href="http://glynndba.blogspot.com/2009/09/sql-from-sql.html?c=3">SQL from SQL</a> offers some powerful examples. <a href="http://ronaldbradford.com/blog"><strong>Ronald Bradford</strong></a> contributes another example in <a href="http://ronaldbradford.com/blog/mysql-dml-stats-per-table-2009-09-09/">MySQL DML stats per table</a>. It would be fun if someone would collect these and post them somewhere as a script to add at the end of our <em>.profile </em>or <em>.bashrc</em> files.</p>
<p><a href="http://sarahdba.blogspot.com"><strong>Sarah Sproehnle</strong></a> wrote two interesting articles this week. The first one explaining in simple terms when and how to use MySQL&#8217;s Query Cache in <a href="http://sarahdba.blogspot.com/2009/09/mysqls-query-cache.html?c=3">MySQL&#8217;s query cache</a> and the other one about how to overcome one of MySQL&#8217;s partitioning limitations in <a href="http://everythingmysql.ning.com/profiles/blogs/partitioning-by-dates-the?c=4">Partitioning by dates: the quick how-to</a>. <a class="nolink"> </a></p>
<p>The <a href="http://www.facebook.com/notes.php?id=102841356695"><strong>MySQL@Facebook blog</strong></a> always offers very deep technical articles and these 2 on InnoDB I/O are no exception: <span id="more-3949"></span> <a href="http://www.facebook.com/note.php?note_id=135613870932">When does InnoDB do disk IO?</a> and <a href="http://www.facebook.com/note.php?note_id=134892580932">MySQL@Facebook: Too much IO?</a>. I wonder when I will have some time to test the <a href="https://launchpad.net/mysqlatfacebook">Facebook patch for MySQL</a>.</p>
<h3>SQL Server</h3>
<p><a href="http://blogs.technet.com/wardpond/archive/2009/09/04/database-programming-did-you-know-in-can-do-this.aspx?c=2">Database Programming: Did You Know IN Can Do This?</a> &#8230; the title says it all, you&#8217;ll have to read this short article to find out.</p>
<p><a href="http://sqlblog.com/blogs/ben_nevarez/"><strong>Ben Nevarez</strong></a> offers an insight into <strong>SQL Server</strong>&#8217;s optimizer in <a href="http://sqlblog.com/blogs/ben_nevarez/archive/2009/09/03/how-the-query-optimizer-uses-statistics.aspx?c=2">How the Query Optimizer Uses Statistics</a>. Another article worth reading is <a href="http://scarydba.wordpress.com/2009/09/09/spools-in-execution-plans/?c=1">Spools in Execution Plans</a>. Understanding how the optimizer works in your databases server is the key to write good SQL statements.</p>
<p>I have two pet peeves when it comes to the IT Industry practices: 1. Lack of attention to details; and 2. wasted resources. In <a href="http://jasonmassie.com/archive/2009/09/can-you-be-too-thorough/">Can you be too Thorough?</a> <a href="http://jasonmassie.com"><strong>Jason Massie</strong></a> talks about being thorough (a way to have <em>attention to detail</em>), and knowing when to stop in a project (a way to avoid <em>waste of resources</em>). <a href="http://thomaslarock.com"><strong>Thomas LaRock</strong></a> offers another twist on the subject with <a href="http://thomaslarock.com/2009/09/reproduce-then-repeat/?c=1">Reproduce, then Repeat</a>.</p>
<h3>Oracle</h3>
<p>Oracle 11gR2 has been released, so it&#8217;s time to start looking into the details. <a href="http://antognini.ch"><strong>Christian Antognini</strong></a>&#8217;s <a href="http://antognini.ch/2009/09/deferred-segment-creation/?c=11">Deferred Segment Creation</a> and his <a href="http://antognini.ch/2009/09/script-to-download-11gr2-documentation/?c=7">Script to Download 11gR2 Documentation</a> are useful articles to get going. If you need help upgrading, read <a href="http://askdba.org/weblog/2009/09/get-upgrading-steps-to-upgrade-to-11gr2/">Get Upgrading: Steps To Upgrade To 11gR2</a> by <a href="http://askdba.org/weblog"><strong>Saurabh Sood</strong></a>.</p>
<p>Analytical functions can be a pain in all databases. The detailed article from <a href="http://jonathanlewis.wordpress.com"><strong>Jonathan Lewis</strong></a> &#8212; <a href="http://jonathanlewis.wordpress.com/2009/09/07/analytic-agony/?c=5">Analytic Agony</a> looks into ways to alleviate that pain.</p>
<p><em>Since Oracle 10.2 it&#8217;s valid to say that buffer cache can be stored inside shared pool.</em> If you are curious about this fact, <a href="http://blog.tanelpoder.com/"><strong>Tanel Poder</strong></a> delivers the proof in <a href="http://blog.tanelpoder.com/2009/09/09/kgh-no-access-allocations-in-vsgastat-buffer-cache-within-shared-pool/?=8">KGH: NO ACCESS allocations in V$SGASTAT &#8211; buffer cache within shared pool!</a>. Heed the warning and do not run the examples in a production environment unless you want a posse of users hunting you down your company hallways.</p>
<p>Did I mention already how much I like simple shell tricks? <a href="http://jkstill.blogspot.com"><strong>Jared Still</strong></a> offers some <a href="http://jkstill.blogspot.com/2009/09/shell-tricks.html?c=11">Shell Tricks</a> for the Oracle fans.</p>
<p>Last but not least, another article addressing <em>attention to detail</em> on which <a href="http://www.remotedbaexperts.com/Blog"><strong>Chris Foot</strong></a> gives it a funny name: <strong>Poka-Yoke</strong>. You&#8217;ll have to read <a href="http://www.remotedbaexperts.com/Blog/2009/09/the-art-of-being-a-successful-dba-poka-yoke-and-paranoid-dba-best-practices/?c=8">The Art of Being a Successful DBA &#8211; Poka-Yoke and Paranoid DBA Best Practices</a> to know what it means.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3949/log-buffer-161-a-carnival-of-the-vanities-for-dbas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Sphinx Search Engine with MySQL</title>
		<link>http://www.pythian.com/news/3782/using-the-sphinx-search-engine-with-mysql/</link>
		<comments>http://www.pythian.com/news/3782/using-the-sphinx-search-engine-with-mysql/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 21:49:19 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[bottlenecks]]></category>
		<category><![CDATA[Full Text Search]]></category>
		<category><![CDATA[myisam]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Pythian]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[sphinx]]></category>
		<category><![CDATA[sphinx.conf]]></category>
		<category><![CDATA[sphinxse]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3782</guid>
		<description><![CDATA[MySQL Full Text Search Limitations
Suppose you have a MyISAM table containing a column with a full text index. This table starts to grow to a significant size (millions of rows) and gets updated fairly frequently. Chances are that you&#8217;ll start to see some bottlenecks when accessing this table, since without row level locking, the reading [...]]]></description>
			<content:encoded><![CDATA[<h3>MySQL Full Text Search Limitations</h3>
<p>Suppose you have a MyISAM table containing a column with a full text index. This table starts to grow to a significant size (millions of rows) and gets updated fairly frequently. Chances are that you&#8217;ll start to see some bottlenecks when accessing this table, since without row level locking, the reading and writing operations will be blocking each other.</p>
<p>A solution that many people would suggest right away is to use the master for writes and a slave for reads, but this only masks the problem, and it won&#8217;t take long before enough read traffic on the slave starts causing slave lags.</p>
<h3>Why Sphinx?</h3>
<p><span id="more-3782"></span></p>
<p>The main difference between <a href="http://www.sphinxsearch.com">the Sphinx search engine</a> and other alternatives is its close integration with MySQL. For example, it can be used as a storage engine.  In this way, Sphinx&#8217;s impact on existing application code can be minimized, opening the door for its more advanced features in future releases.</p>
<h3>Initial Considerations</h3>
<h4>Need to compile MySQL from source</h4>
<p>I struggled with this one for a while, until I realized that the <strong>storage engine plugins</strong> only work if the full version number of the MySQL server matches the full version number of the MySQL libraries used in the compilation; and if compiler options for the server, libraries, and plugin also match.</p>
<p>I couldn&#8217;t find any other reliable way of getting everything to work together than grabbing a MySQL source tarball and compiling it with Sphinx SE. The process is straightforward if you follow the procedures in the MySQL&#8217;s manual: <a href="http://dev.mysql.com/doc/refman/5.1/en/quick-install.html">2.10.1. Source Installation Overview</a>.</p>
<h4>Use MySQL 5.1.xx</h4>
<p>Although it is possible to use Sphinx with 5.0.xx, I like the cleaner plug-in storage interface of 5.1.xx.</p>
<h4>The table to be indexed needs a unique <code>INT</code> column</h4>
<p>The table for which you are going to create a full text index has to have an <code>INT</code> column declared as <code>UNIQUE KEY</code>. This value is the one to which Sphinx has to point the rows containing the text in its indexes.</p>
<h3>Putting everything together</h3>
<p>Both Sphinx and MySQL have very clear and straightforward instructions on how to compile from the source code tarballs, so just follow the steps. Although I had to run several options until I got all the right pieces in place, compiling either tool was never an issue.</p>
<p>The instructions for installing Sphinx can be found in its online documentation <a href="http://www.sphinxsearch.com/docs/current.html#installing">2.3. Installing Sphinx on Linux</a>; and to compile into MySQL 5.1 in <a href="http://www.sphinxsearch.com/docs/current.html#sphinxse-mysql51">7.2.2. Compiling MySQL 5.1.x with SphinxSE</a>.</p>
<p>When Sphinx is installed, it has two different sample configuration files. One is very comprehensive and the other is <em>clean, simple, functional</em>, as billed in its header. Use the latter one to get started.</p>
<h3>Example run</h3>
<p>As always, I use the <a href="http://amarok.kde.org">Amarok player</a> MySQL database as an example and in this case, I used the <strong>lyrics</strong> table.</p>
<p>In the <strong>sphinx.conf</strong> file I used the following line to index the table:</p>
<pre>	sql_query			= \
		SELECT lid, url, lyrics FROM lyrics</pre>
<p>Notice that with this configuration line, I&#8217;ll be indexing both the song title (the file name, really) and the lyrics text.</p>
<p>After I added an <code>INT AUTO_INCREMENT PRIMARY KEY</code> column to the <strong>lyrics</strong> table and converted it into InnoDB, the resulting table was:</p>
<pre>show create table lyrics\G
*************************** 1. row ***************************
       Table: lyrics
Create Table: CREATE TABLE `lyrics` (
  `lid` int(11) NOT NULL AUTO_INCREMENT,
  `url` varbinary(255) DEFAULT NULL,
  `deviceid` int(11) DEFAULT NULL,
  `lyrics` text,
  `uniqueid` varbinary(32) DEFAULT NULL,
  PRIMARY KEY (`lid`),
  UNIQUE KEY `lyrics_url` (`url`,`deviceid`),
  KEY `lyrics_uniqueid` (`uniqueid`)
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=latin1</pre>
<p>Once the table was in place, I ran Sphinx&#8217;s <strong>indexer</strong> utility to create the full text indexes.</p>
<p>Then I added the <code>SPHINX</code> table as per the documentation:</p>
<pre>show create table sphinx_search\G
*************************** 1. row ***************************
       Table: sphinx_search
Create Table: CREATE TABLE `sphinx_search` (
  `id` int(11) NOT NULL,
  `weight` int(11) NOT NULL,
  `query` varchar(3072) NOT NULL,
  KEY `query` (`query`)
) ENGINE=SPHINX DEFAULT CHARSET=latin1 CONNECTION='sphinx://localhost:3312/test1'</pre>
<p>A difference from the examples in Sphinx&#8217;s documentation is that I left out any additional attributes. And finally, I created a view to hide as many implementation details as possible</p>
<pre>CREATE VIEW `vlyrics` AS select `ly`.`lid` AS `vlid`,
            `ly`.`url` AS `vurl`,
            `ly`.`deviceid` AS `vdevicedid`,
            `ly`.`lyrics` AS `vlyrics`,
            `ly`.`uniqueid` AS `vuniqueid`,
            `ss`.`query` AS `vquery`
FROM (`sphinx_search` `ss` join `lyrics` `ly`) WHERE (`ss`.`id` = `ly`.`lid`);</pre>
<p>Last but not least, I found out how many songs have the word &#8220;death&#8221; in their lyrics (I was going to use &#8220;love&#8221;, but it sounded too lame):</p>
<pre>select vlid, vurl from vlyrics where vquery = 'death';
+------+------------------------------------------------------------------------------------------------------------+
| vlid | vurl                                                                                                       |
+------+------------------------------------------------------------------------------------------------------------+
|   60 | ./opt/musica/iTunes Music/Genesis/The Lamb Lies Down on Broadway Disc 2/03 Anyway.wma                      |
|   66 | ./opt/musica/iTunes Music/Compilations/Evita_ Premiere American Recording (Disc/1-04 Buenos Aires.mp3      |
|   88 | ./opt/musica/iTunes Music/Lake_&amp;_Palmer_Emerson/Works__Vol._1/06_-_Closer_To_Believing_(Album_Version).mp3 |
+------+------------------------------------------------------------------------------------------------------------+
3 rows in set (0.04 sec)</pre>
<p>Notice that in this case the the character &#8220;=&#8221; doesn&#8217;t mean &#8220;equals&#8221;, but &#8220;contains&#8221;. If I had renamed the original table and used its name for the view, this would have been the only change as opposed to using &#8220;like&#8221;:</p>
<pre>select lid, url from lyrics where lyrics like '%death%';
+-----+------------------------------------------------------------------------------------------------------------+
| lid | url                                                                                                        |
+-----+------------------------------------------------------------------------------------------------------------+
|  60 | ./opt/musica/iTunes Music/Genesis/The Lamb Lies Down on Broadway Disc 2/03 Anyway.wma                      |
|  66 | ./opt/musica/iTunes Music/Compilations/Evita_ Premiere American Recording (Disc/1-04 Buenos Aires.mp3      |
|  88 | ./opt/musica/iTunes Music/Lake_&amp;_Palmer_Emerson/Works__Vol._1/06_-_Closer_To_Believing_(Album_Version).mp3 |
+-----+------------------------------------------------------------------------------------------------------------+
3 rows in set (0.02 sec)</pre>
<p><strong>Note: </strong>disregard the times for each query&#8212;the table has only about 100 rows.</p>
<h3>Conclusion</h3>
<p>Implementing SphinxSE into MySQL proved to be easier than it seemed in the beginning, although it took some time to compile and install everything. With a creative use of views, it could potentially be implemented right away in legacy applications, offering numerous advantages.</p>
<p>Sphinx offers many additional features that I do not consider here. I recommend looking into the documentation to implement the more sophisticated indexing mechanisms and search methods.</p>
<p>This evaluation was done with Sphinx v0.9.8, which is labeled as <em>stable</em> since it was done for a customer project. Version 0.9.9, the current release candidate, has an new  feature: it supports the MySQL communications protocol. This makes it possible to query text search engine directly using MySQL&#8217;s client libraries, which opens a new set of interesting possibilities.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3782/using-the-sphinx-search-engine-with-mysql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bug When Compiling MySQL 5.1 From Source</title>
		<link>http://www.pythian.com/news/2874/bug-when-compiling-mysql-51-from-source/</link>
		<comments>http://www.pythian.com/news/2874/bug-when-compiling-mysql-51-from-source/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 18:55:43 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[Group Blog Posts]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[compiling]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[sphinx]]></category>
		<category><![CDATA[sphinxse]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=2874</guid>
		<description><![CDATA[I just filed a very annoying bug when trying to compile with plugin engines using the 5.1.xx source tarball.
Description
I am trying to test SphinxSE as a plugin instead of getting it statically linked and came across an annoying bug. When using the configure --with-plugins option only once, the engine is statically linked. When using it [...]]]></description>
			<content:encoded><![CDATA[<p>I just filed a very annoying bug when trying to compile with plugin engines using the 5.1.xx source tarball.</p>
<h3>Description</h3>
<p>I am trying to test <A HREF=http://www.sphinxsearch.com/downloads.html>SphinxSE as a plugin</A> instead of getting it statically linked and came across an annoying bug. When using the configure <code>--with-plugins</code> option only once, the engine is statically linked. When using it twice, the first engine is created as a plugin, and the 2nd one is linked statically. Here are a couple of examples:<br />
<span id="more-2874"></span></p>
<blockquote>
<pre>./configure --prefix=/usr/local/mysql-5.1.33 --with-plugins=innobase --with-plugins=sphinx</pre>
<pre>plugin_innobase_shared_target='ha_innodb.la'   <strong>&lt;-- plugin</strong>
plugin_innobase_static_target=''
plugin_sphinx_shared_target=''
plugin_sphinx_static_target='libsphinx.a'       <strong>&lt;-- static
</strong>./configure --prefix=/usr/local/mysql-5.1.33 --with-plugins=sphinx --with-plugins=innobase</pre>
<pre>~/src/mysql-5.1.33$ egrep "plugin_(innobase|sphinx)" config.log
plugin_innobase_shared_target=''
plugin_innobase_static_target='libinnobase.a'     <strong> &lt;-- static</strong>
plugin_sphinx_shared_target='ha_sphinx.la'         <strong>&lt;-- plugin</strong>
plugin_sphinx_static_target=''</pre>
</blockquote>
<p>The bug is filed as <a title="Bug #45440" href="http://bugs.mysql.com/45440" target="_blank">Bug #45440</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/2874/bug-when-compiling-mysql-51-from-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My Two Cents on MySQL Password Security</title>
		<link>http://www.pythian.com/news/2730/my-two-cents-on-mysql-password-security/</link>
		<comments>http://www.pythian.com/news/2730/my-two-cents-on-mysql-password-security/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 20:32:49 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[grant]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[show grants]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=2730</guid>
		<description><![CDATA[Lenz Grimmer recently wrote two blogs about password security on MySQL. Both are worth reading in detail. You&#8217;ll find them in Basic MySQL Security: Providing passwords on the command line and More on MySQL password security. 
Although I wrote a comment on the latter one, there is one point I thought was worth its own [...]]]></description>
			<content:encoded><![CDATA[<p>Lenz Grimmer recently wrote two blogs about password security on MySQL. Both are worth reading in detail. You&#8217;ll find them in <a href="http://www.lenzg.net/archives/256-Basic-MySQL-Security-Providing-passwords-on-the-command-line.html">Basic MySQL Security: Providing passwords on the command line</a> and <a href="http://www.lenzg.net/index.php?url=archives/257-More-on-MySQL-password-security.html">More on MySQL password security</a>. </p>
<p>Although I wrote a comment on the latter one, there is one point I thought was worth its own blog.  <span id="more-2730"></span></p>
<h3>GRANT &#8230; IDENTIFIED BY PASSWORD&#8230;</h3>
<p>You can work around having to specify the password in the open following these steps:</p>
<ol>
<li>Use a local or non-public instance (for example using MySQL Sandbox) to define the user / password combination you need:
<pre>CREATE USER 'name'@'host' IDENTIFIED BY 'secret';</pre>
</li>
<li>Use <code>SHOW GRANTS</code> to get the hashed password:
<pre>SHOW GRANTS FOR 'name'@'host';
+------------------------------------------------------------------------------+
| Grants for name@host                                                         |
+------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'name'@'host' IDENTIFIED BY PASSWORD '*&lt;hash value&gt;'   |
+------------------------------------------------------------------------------+</pre>
</li>
<li>Log in to the production (or public) server and use  <code>CREATE USER</code> with the hash value obtained above:
<pre>CREATE USER 'name'@'host' IDENTIFIED BY '*&lt;hash value&gt;'</pre>
</li>
</ol>
<p>This way, even if the <code>CREATE USER ...</code> (or <code>GRANT</code>) shows in plain text in the MySQL history, binary logs or anywhere else, the password remains secret.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/2730/my-two-cents-on-mysql-password-security/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Oracle Buys Sun: What About MySQL?</title>
		<link>http://www.pythian.com/news/2086/oracle-buys-sun-what-about-mysql/</link>
		<comments>http://www.pythian.com/news/2086/oracle-buys-sun-what-about-mysql/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 18:32:56 +0000</pubDate>
		<dc:creator>Gerry Narvaja</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Sun]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=2086</guid>
		<description><![CDATA[If you review the recent years of Oracle&#8217;s history, you&#8217;ll see that its purchase of Sun makes perfect sense. Oracle has tried to get in the OS business (Oracle Ubreakable Linux), the hardware business with their different partnerships (e.g.: Hewlett Packard Partner Relationship), and even into the MySQL business back when they bought InnoBase (Oracle [...]]]></description>
			<content:encoded><![CDATA[<p>If you review the recent years of Oracle&#8217;s history, you&#8217;ll see that its purchase of Sun makes perfect sense. Oracle has tried to get in the OS business (<a href="http://www.oracle.com/technologies/linux/index.html">Oracle Ubreakable Linux</a>), the hardware business with their different partnerships (e.g.: <a href="http://www.oracle.com/partnerships/hw/hp/index.html">Hewlett Packard Partner Relationship</a>), and even into the MySQL business back when they bought InnoBase (<a href="http://www.oracle.com/innobase/index.html">Oracle and Innobase</a>).</p>
<p>MySQL was in many ways  a leader for the Open Source industry, both in the way the way it marketed <abbr title="Open Source Software">OSS</abbr> and in the way MySQL the company was built. It&#8217;s the latter aspect that worries me. MySQL was a world pioneer in having a global workforce and this shaped both its culture and products.</p>
<p>When I joined MySQL in 2001, 90% of the company was distributed outside their native Swedish offices. (When Sun bought it, it was down to 80% outside the Cupertino headquarters, which I&#8217;m sure is still more than any large or middle-size corporation can claim.) This meant that they hired the best talent they could find wherever they found it, and that they could follow the talent wherever it went. During my years at MySQL, many people moved around from country to country without affecting their jobs. This diversity and flexibility shaped everything the company did, and indeed, the different backgrounds of those involved greatly influenced the characteristics of MySQL AB&#8217;s products and services themselves.</p>
<p>Sun was already deep into distributing its workforce when they acquired MySQL, so of all the big corporations, it was probably the one that best fit MySQL&#8217;s culture. Oracle, however, is a very different story, and I&#8217;m not sure how the distributed workforce that the Sun and MySQL employees are used to, will fit into the new organization. This change will affect MySQL&#8217;s future&#8212;I&#8217;m not sure how, but it will be very different from the MySQL we know.</p>
<p>(On a side note, although I don&#8217;t think Oracle is buying Sun <em>because</em> of MySQL, it looks like the Twitter community thinks so: both <a href="http://twitter.com/timeline/search?q=Oracle&amp;source=sidebar&amp;category=trends">#oracle</a> and <a href="http://twitter.com/timeline/search?q=MySQL&amp;source=sidebar&amp;category=trends">#mysql</a> are on the top 10 topics right now. Check both Twitter feeds, if nothing else, they&#8217;re fun.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/2086/oracle-buys-sun-what-about-mysql/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
