<?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; analysis</title>
	<atom:link href="http://planetmysql.ru/category/analysis/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetmysql.ru</link>
	<description>Блог о самой популярной СУБД MySQL</description>
	<lastBuildDate>Thu, 24 May 2012 05:41:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>common_schema, rev. 178: foreach(), repeat_exec(), Roland Bouman, query analysis</title>
		<link>http://code.openark.org/blog/mysql/common_schema-rev-178-foreach-repeat_exec-roland-bouman-query-analysis?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=common_schema-rev-178-foreach-repeat_exec-roland-bouman-query-analysis</link>
		<comments>http://code.openark.org/blog/mysql/common_schema-rev-178-foreach-repeat_exec-roland-bouman-query-analysis#comments</comments>
		<pubDate>Thu, 01 Dec 2011 09:33:01 +0000</pubDate>
		<dc:creator>Shlomi Noach</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[common_schema]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[stored routines]]></category>

		<guid isPermaLink="false">http://code.openark.org/blog/?p=4133</guid>
		<description><![CDATA[common_schema, revision 178 is now released, with major additions. This revision turns common_schema into a framework, rather than a set of views and functions.
common_schema provides with query scripting, analysis &#38; informational views, and a function library, allowing for easier administration and diagnostics for MySQL. It introduces SQL based tools which simplify otherwise complex shell and client scripts, allowing the DBA to be independent of operating system, installed packages and dependencies.
There's no Perl nor Python, and no dependencies to install. It's just a schema.
Some highlights for the new revision:

foreach(), aka $(): loop through a collection, execute callback commands per element.
repeat_exec(): a repeat-until device: execute queries until some condition holds.
exec_file(): execute files a-la SOURCE, but on server side
Query analysis: analyze query text, view or routine definitions to detect dependency objects.
Improvements to views and routines, new routines introduced.

Let's take a closer look:
rpbouman
I'm very happy to have Roland Bouman working on this project. He introduced some sophisticated code without which some functionality could not take place. I'm sure I don't need to introduce his great capabilities; I'll just pass the note that it is very good working with him!
foreach()
Introducing a looping device which can iterate a collection and execute callback commands.
What's a collection? A range of numbers; a set of constants; the result set of a SELECT query; tables in your database and more.
What is a callback? A query or set of queries to invoke on the specific elements in the collection. For example:

call foreach('table in sakila', 'ALTER TABLE ${schema}.${table} ENGINE=InnoDB ROW_FORMAT=COMPRESSED');

I'll publish dedicated posts on foreach(), aka $(), following this post. Official documentation is here.
repeat_exec()
Repeat executing queries in a given interval, until some condition holds.
What kind of condition? You can loop forever, or until a given time has passed, a given number of iteration has passed.
You can iterate until no rows are affected by your commands (your callbacks), or until some dynamic condition holds (a query evaluates to true).
For example: purge rows from a table until no more rows are affected; in interval of 3 second:

call repeat_exec(3, 'DELETE FROM test.event WHERE ts &#60; CURDATE() ORDER BY id LIMIT 1000', 0);

Official documentation is here.
exec_file()
If you need to execute commands from a file, you usually invoke SOURCE:

mysql&#62; SOURCE '/tmp/somefile.sql';

Or you invoke mysql client and redirect its input to read from file:

bash$ mysql some_db &#60; /tmp/somefile.sql

SOURCE is a MySQL client command. The file must reside on your client. Running the mysql client is great, but you need to work it out from outside the server.
call_exec() will let you import a file on server side, from within the server:

call exec_file('/tmp/some_file.sql');

You will need to have the file readable; it is limited to 64K at this moment; it may not use DELIMITER, and it may not include dynamic SQL. These are the limitations.
Official documentation is here.
exec() / exec_single()
All of the above rely on the exec() / exec_single() routines, which dynamically execute a set of queries. One one hand, it's no big deal: they only have to use prepared statements in order to invoke the queries. But then, they knows how to parse multiple queries (find the ";" delimiter correctly), plus they allow for configuration: if you set @common_schema_dryrun, queries are not actually executes; just printed out. If you set @common_schema_verbose, queries are verbosed in addition to being executed. Since all execution routines rely on these,we get a standardized pattern.
Official documentation is here.
Query analysis
Query parsing routines allow for detection of dependencies within queries. While not full-blown SQL parser, these allow one to realize on which tables or routines a view depends on; or a routines depends on; or an event; or just any query.
These routines can analyze the text of not only a SELECT query, but also UPDATE, DELETE, CREATE, etc. They can read the code of a stored routines, including queries and control flow constructs; thus, they are also able to analyze events and triggers.
At this stage forward-dependencies resolution is supported. This can eventually lead to dependency graphs or to reverse-dependency resolution (i.e. "which view, routine, trigger or event depend on table t?")
Example:

mysql&#62; call get_view_dependencies('sakila', 'actor_info');
+-------------+---------------+-------------+--------+
&#124; schema_name &#124; object_name   &#124; object_type &#124; action &#124;
+-------------+---------------+-------------+--------+
&#124; sakila      &#124; actor         &#124; table       &#124; select &#124;
&#124; sakila      &#124; category      &#124; table       &#124; select &#124;
&#124; sakila      &#124; film          &#124; table       &#124; select &#124;
&#124; sakila      &#124; film_actor    &#124; table       &#124; select &#124;
&#124; sakila      &#124; film_category &#124; table       &#124; select &#124;
+-------------+---------------+-------------+--------+

The query analysis routines are in BETA stage.
Official documentation is here.
Test quite
common_schema is now tested. Not all code is as yet under tests; all new code is, and some of the older code. Work is in progress to add more and more tests.
Further changes:

candidate_keys does not give higher score for PRIMARY KEYs any longer. It ranks all unique keys according to its own heuristic; it also provides with the  is_primary and is_nullable columns.
Added candidate_keys_recommended view, recommending best candidate key per table (while noting whether it qualifies as PRIMARY KEY in terms of NULLable columns).
Added many text parsing and text manipulation routines, such as better trim, tokenizing, etc. Improved existing code significantly.

Get it
common_schema is available for downloaded. It is released under the BSD license, and is free.
I've put very hard work into common_schema's documentation. It is very thorough and provides with clear examples. The documentation is also available for download.
If you encounter problems, please report on the issues page.
common_schema is meant to be downloaded &#38; installed on any MySQL server. It provides with general and essential functionality. Spread the word!]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/common-schema/" rel="nofollow">common_schema</a>, revision <strong>178</strong> is now released, with major additions. This revision turns <em>common_schema</em> into a <em>framework</em>, rather than a set of views and functions.</p>
<p><em>common_schema</em> provides with query scripting, analysis &amp; informational views, and a function library, allowing for easier administration and diagnostics for MySQL. It introduces SQL based tools which simplify otherwise complex shell and client scripts, allowing the DBA to be independent of operating system, installed packages and dependencies.</p>
<p>There's no Perl nor Python, and no dependencies to install. It's just a <em>schema</em>.</p>
<p>Some highlights for the new revision:</p>
<ul>
<li><strong>foreach()</strong>, aka <strong>$()</strong>: loop through a collection, execute callback commands per element.</li>
<li><strong>repeat_exec()</strong>: a repeat-until device: execute queries until some condition holds.</li>
<li><strong>exec_file()</strong>: execute files a-la SOURCE, but on server side</li>
<li><strong>Query analysis</strong>: analyze query text, view or routine definitions to detect dependency objects.</li>
<li>Improvements to views and routines, new routines introduced.</li>
</ul>
<p>Let's take a closer look:</p>
<h4>rpbouman</h4>
<p>I'm very happy to have <a href="http://rpbouman.blogspot.com/">Roland Bouman</a> working on this project. He introduced some sophisticated code without which some functionality could not take place. I'm sure I don't need to introduce his great capabilities; I'll just pass the note that it is very good working with him!</p>
<h4>foreach()</h4>
<p>Introducing a looping device which can iterate a collection and execute callback commands.</p>
<p>What's a collection? A range of numbers; a set of constants; the result set of a <strong>SELECT</strong> query; tables in your database and more.</p>
<p>What is a callback? A query or set of queries to invoke on the specific elements in the collection. For example:</p>
<blockquote>
<pre>call <strong>foreach</strong>(<span>'table in sakila'</span>, <span>'ALTER TABLE ${schema}.${table} ENGINE=InnoDB ROW_FORMAT=COMPRESSED'</span>);</pre>
</blockquote>
<p>I'll publish dedicated posts on <em>foreach()</em>, aka <em>$()</em>, following this post. Official documentation is <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/foreach.html">here</a>.</p>
<h4>repeat_exec()</h4>
<p>Repeat executing queries in a given interval, until some condition holds.</p>
<p>What kind of condition? You can loop forever, or until a given time has passed, a given number of iteration has passed.<span></span></p>
<p>You can iterate until no rows are affected by your commands (your callbacks), or until some dynamic condition holds (a query evaluates to <strong>true</strong>).</p>
<p>For example: purge rows from a table until no more rows are affected; in interval of <strong>3</strong> second:</p>
<blockquote>
<pre>call <strong>repeat_exec</strong>(3, 'DELETE FROM test.event WHERE ts &lt; CURDATE() ORDER BY id LIMIT 1000', 0);</pre>
</blockquote>
<p>Official documentation is <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/repeat_exec.html">here</a>.</p>
<h4>exec_file()</h4>
<p>If you need to execute commands from a file, you usually invoke SOURCE:</p>
<blockquote>
<pre>mysql&gt; SOURCE '/tmp/somefile.sql';</pre>
</blockquote>
<p>Or you invoke mysql client and redirect its input to read from file:</p>
<blockquote>
<pre>bash$ mysql some_db &lt; /tmp/somefile.sql</pre>
</blockquote>
<p><strong>SOURCE</strong> is a MySQL client command. The file must reside on your client. Running the <strong>mysql</strong> client is great, but you need to work it out from <em>outside</em> the server.</p>
<p><em>call_exec()</em> will let you import a file <em>on server side</em>, from <em>within the server</em>:</p>
<blockquote>
<pre>call <strong>exec_file</strong>('/tmp/some_file.sql');</pre>
</blockquote>
<p>You will need to have the file readable; it is limited to 64K at this moment; it may not use DELIMITER, and it may not include dynamic SQL. These are the limitations.</p>
<p>Official documentation is <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/exec_file.html">here</a>.</p>
<h4>exec() / exec_single()</h4>
<p>All of the above rely on the <em>exec()</em> / <em>exec_single()</em> routines, which dynamically execute a set of queries. One one hand, it's no big deal: they only have to use prepared statements in order to invoke the queries. But then, they knows how to parse multiple queries (find the ";" delimiter correctly), plus they allow for configuration: if you set <strong>@common_schema_dryrun</strong>, queries are not actually executes; just printed out. If you set <strong>@common_schema_verbose</strong>, queries are verbosed in addition to being executed. Since all execution routines rely on these,we get a standardized pattern.</p>
<p>Official documentation <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/exec_single.html">is</a> <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/exec.html">here</a>.</p>
<h4>Query analysis</h4>
<p>Query parsing routines allow for detection of dependencies within queries. While not full-blown SQL parser, these allow one to realize on which tables or routines a view depends on; or a routines depends on; or an event; or just any query.</p>
<p>These routines can analyze the text of not only a <strong>SELECT</strong> query, but also <strong>UPDATE</strong>, <strong>DELETE</strong>, <strong>CREATE</strong>, etc. They can read the code of a stored routines, including queries and control flow constructs; thus, they are also able to analyze events and triggers.</p>
<p>At this stage forward-dependencies resolution is supported. This can eventually lead to dependency graphs or to reverse-dependency resolution (i.e. "which view, routine, trigger or event depend on table <strong>t</strong>?")</p>
<p>Example:</p>
<blockquote>
<pre>mysql&gt; call <strong>get_view_dependencies</strong>('sakila', 'actor_info');
+-------------+---------------+-------------+--------+
| schema_name | object_name   | object_type | action |
+-------------+---------------+-------------+--------+
| sakila      | actor         | table       | select |
| sakila      | category      | table       | select |
| sakila      | film          | table       | select |
| sakila      | film_actor    | table       | select |
| sakila      | film_category | table       | select |
+-------------+---------------+-------------+--------+</pre>
</blockquote>
<p>The query analysis routines are in BETA stage.</p>
<p>Official documentation is <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/query_analysis_routines.html">here</a>.</p>
<h4>Test quite</h4>
<p><em>common_schema</em> is now tested. Not all code is as yet under tests; all new code is, and some of the older code. Work is in progress to add more and more tests.</p>
<h4>Further changes:</h4>
<ul>
<li><strong>candidate_keys</strong> does not give higher score for <strong>PRIMARY KEY</strong>s any longer. It ranks all unique keys according to its own heuristic; it also provides with the  <strong>is_primary</strong> and <strong>is_nullable</strong> columns.</li>
<li>Added <strong>candidate_keys_recommended</strong> view, recommending best candidate key per table (while noting whether it qualifies as <strong>PRIMARY KEY</strong> in terms of <strong>NULL</strong>able columns).</li>
<li>Added many text parsing and text manipulation routines, such as better trim, tokenizing, etc. Improved existing code significantly.</li>
</ul>
<h4>Get it</h4>
<p><em>common_schema</em> is <a href="http://code.google.com/p/common-schema/">available for downloaded</a>. It is released under the <strong>BSD</strong> license, and is free.</p>
<p>I've put very hard work into <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/introduction.html">common_schema's documentation</a>. It is very thorough and provides with clear examples. The documentation is also available for download.</p>
<p>If you encounter problems, <a href="http://code.google.com/p/common-schema/issues/list">please report on the issues page</a>.</p>
<p><em>common_schema</em> is meant to be downloaded &amp; installed on any MySQL server. It provides with general and essential functionality. Spread the word!</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=31085&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=31085&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2011/12/01/common_schema-rev-178-foreach-repeat_exec-roland-bouman-query-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Global status difference using single query</title>
		<link>http://code.openark.org/blog/mysql/mysql-global-status-difference-using-single-query?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-global-status-difference-using-single-query</link>
		<comments>http://code.openark.org/blog/mysql/mysql-global-status-difference-using-single-query#comments</comments>
		<pubDate>Fri, 12 Aug 2011 16:31:36 +0000</pubDate>
		<dc:creator>Shlomi Noach</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[common_schema]]></category>
		<category><![CDATA[information_schema]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://code.openark.org/blog/?p=3908</guid>
		<description><![CDATA[Have just read MySQL Global status difference using MySQL procedures / functions, by Andres Karlsson. Have commented, but realized I did not provide with a direct answer. In the comment, I suggested checking out a solution based on views, found in common_schema. But the solution in common_schema is split into two views, due to the fact views cannot handle derived tables subqueries.
Well, here&#8217;s a single query to do that: it checks GLOBAL_STATUS twice, 10 seconds apart in the following sample. It uses SLEEP() to actually wait between the two reads. Yes, you can do that with a query.
The following query shows all GLOBAL_STATUS values that have changed during the sample period.

SELECT STRAIGHT_JOIN
   LOWER(gs0.VARIABLE_NAME) AS variable_name,
   gs0.VARIABLE_VALUE AS variable_value_0,
   gs1.VARIABLE_VALUE AS variable_value_1,
   (gs1.VARIABLE_VALUE - gs0.VARIABLE_VALUE) AS variable_value_diff,
   (gs1.VARIABLE_VALUE - gs0.VARIABLE_VALUE) / 10 AS variable_value_psec,
   (gs1.VARIABLE_VALUE - gs0.VARIABLE_VALUE) * 60 / 10 AS
variable_value_pminute
FROM
   (
     SELECT
       VARIABLE_NAME,
       VARIABLE_VALUE
     FROM
       INFORMATION_SCHEMA.GLOBAL_STATUS
     UNION ALL
     SELECT
       '',
       SLEEP(10)
     FROM DUAL
   ) AS gs0
   JOIN INFORMATION_SCHEMA.GLOBAL_STATUS gs1 USING (VARIABLE_NAME)
WHERE
   gs1.VARIABLE_VALUE != gs0.VARIABLE_VALUE
;
+-----------------------------------+------------------+------------------+---------------------+---------------------+------------------------+
&#124; variable_name                     &#124; variable_value_0 &#124; variable_value_1 &#124; variable_value_diff &#124; variable_value_psec &#124; variable_value_pminute &#124;
+-----------------------------------+------------------+------------------+---------------------+---------------------+------------------------+
&#124; aborted_clients                   &#124; 2210669          &#124; 2210686          &#124;                  17 &#124;                 1.7 &#124;                    102 &#124;
&#124; bytes_received                    &#124; 53259933210      &#124; 53260211104      &#124;              277894 &#124;             27789.4 &#124;                1667364 &#124;
&#124; bytes_sent                        &#124; 351130988015     &#124; 351132884956     &#124;             1896941 &#124;            189694.1 &#124;               11381646 &#124;
&#124; com_change_db                     &#124; 3760546          &#124; 3760584          &#124;                  38 &#124;                 3.8 &#124;                    228 &#124;
&#124; com_delete                        &#124; 6774784          &#124; 6774801          &#124;                  17 &#124;                 1.7 &#124;                    102 &#124;
&#124; com_insert                        &#124; 52743750         &#124; 52744012         &#124;                 262 &#124;                26.2 &#124;                   1572 &#124;
&#124; com_insert_select                 &#124; 13362650         &#124; 13362740         &#124;                  90 &#124;                   9 &#124;                    540 &#124;
&#124; com_select                        &#124; 51722818         &#124; 51723107         &#124;                 289 &#124;                28.9 &#124;                   1734 &#124;
&#124; com_set_option                    &#124; 108564134        &#124; 108564754        &#124;                 620 &#124;                  62 &#124;                   3720 &#124;
&#124; com_show_collations               &#124; 3760530          &#124; 3760568          &#124;                  38 &#124;                 3.8 &#124;                    228 &#124;
&#124; com_show_processlist              &#124; 366078           &#124; 366082           &#124;                   4 &#124;                 0.4 &#124;                     24 &#124;
&#124; com_show_status                   &#124; 366047           &#124; 366051           &#124;                   4 &#124;                 0.4 &#124;                     24 &#124;
&#124; com_show_variables                &#124; 3760535          &#124; 3760573          &#124;                  38 &#124;                 3.8 &#124;                    228 &#124;
&#124; com_update                        &#124; 6271283          &#124; 6271324          &#124;                  41 &#124;                 4.1 &#124;                    246 &#124;
&#124; connections                       &#124; 3781382          &#124; 3781420          &#124;                  38 &#124;                 3.8 &#124;                    228 &#124;
&#124; created_tmp_disk_tables           &#124; 983223           &#124; 983224           &#124;                   1 &#124;                 0.1 &#124;                      6 &#124;
&#124; created_tmp_tables                &#124; 9134044          &#124; 9134126          &#124;                  82 &#124;                 8.2 &#124;                    492 &#124;
&#124; handler_commit                    &#124; 125798040        &#124; 125798688        &#124;                 648 &#124;                64.8 &#124;                   3888 &#124;
&#124; handler_delete                    &#124; 6849562          &#124; 6849578          &#124;                  16 &#124;                 1.6 &#124;                     96 &#124;
&#124; handler_read_first                &#124; 5332451          &#124; 5332498          &#124;                  47 &#124;                 4.7 &#124;                    282 &#124;
&#124; handler_read_key                  &#124; 373910509        &#124; 373912469        &#124;                1960 &#124;                 196 &#124;                  11760 &#124;
&#124; handler_read_next                 &#124; 850122025        &#124; 850170403        &#124;               48378 &#124;              4837.8 &#124;                 290268 &#124;
&#124; handler_read_rnd                  &#124; 255104660        &#124; 255105932        &#124;                1272 &#124;               127.2 &#124;                   7632 &#124;
&#124; handler_read_rnd_next             &#124; 992505444        &#124; 992549948        &#124;               44504 &#124;              4450.4 &#124;                 267024 &#124;
&#124; handler_update                    &#124; 27930283         &#124; 27930465         &#124;                 182 &#124;                18.2 &#124;                   1092 &#124;
&#124; handler_write                     &#124; 2051582925       &#124; 2051602416       &#124;               19491 &#124;              1949.1 &#124;                 116946 &#124;
&#124; innodb_buffer_pool_pages_data     &#124; 77232            &#124; 77243            &#124;                  11 &#124;                 1.1 &#124;                     66 &#124;
&#124; innodb_buffer_pool_pages_dirty    &#124; 626              &#124; 645              &#124;                  19 &#124;                 1.9 &#124;                    114 &#124;
&#124; innodb_buffer_pool_pages_flushed  &#124; 38429812         &#124; 38430032         &#124;                 220 &#124;                  22 &#124;                   1320 &#124;
&#124; innodb_buffer_pool_pages_misc     &#124; 4294922063       &#124; 4294922052       &#124;                 -11 &#124;                -1.1 &#124;                    -66 &#124;
&#124; innodb_buffer_pool_read_requests  &#124; 1933796064       &#124; 1933871603       &#124;               75539 &#124;              7553.9 &#124;                 453234 &#124;
&#124; innodb_buffer_pool_reads          &#124; 11360212         &#124; 11360214         &#124;                   2 &#124;                 0.2 &#124;                     12 &#124;
&#124; innodb_buffer_pool_write_requests &#124; 1074109722       &#124; 1074115394       &#124;                5672 &#124;               567.2 &#124;                  34032 &#124;
&#124; innodb_data_fsyncs                &#124; 5583880          &#124; 5583905          &#124;                  25 &#124;                 2.5 &#124;                    150 &#124;
&#124; innodb_data_read                  &#124; 3339489280       &#124; 3339501568       &#124;               12288 &#124;              1228.8 &#124;                  73728 &#124;
&#124; innodb_data_reads                 &#124; 11796492         &#124; 11796494         &#124;                   2 &#124;                 0.2 &#124;                     12 &#124;
&#124; innodb_data_writes                &#124; 105587582        &#124; 105588145        &#124;                 563 &#124;                56.3 &#124;                   3378 &#124;
&#124; innodb_data_written               &#124; 3721600000       &#124; 3727315968       &#124;             5715968 &#124;            571596.8 &#124;               34295808 &#124;
&#124; innodb_dblwr_pages_written        &#124; 38429812         &#124; 38430032         &#124;                 220 &#124;                  22 &#124;                   1320 &#124;
&#124; innodb_dblwr_writes               &#124; 596503           &#124; 596506           &#124;                   3 &#124;                 0.3 &#124;                     18 &#124;
&#124; innodb_log_write_requests         &#124; 380978894        &#124; 380981368        &#124;                2474 &#124;               247.4 &#124;                  14844 &#124;
&#124; innodb_log_writes                 &#124; 74407604         &#124; 74407990         &#124;                 386 &#124;                38.6 &#124;                   2316 &#124;
&#124; innodb_os_log_fsyncs              &#124; 2310799          &#124; 2310807          &#124;                   8 &#124;                 0.8 &#124;                     48 &#124;
&#124; innodb_os_log_written             &#124; 2905292800       &#124; 2906502656       &#124;             1209856 &#124;            120985.6 &#124;                7259136 &#124;
&#124; innodb_pages_created              &#124; 1341584          &#124; 1341593          &#124;                   9 &#124;                 0.9 &#124;                     54 &#124;
&#124; innodb_pages_read                 &#124; 13117652         &#124; 13117654         &#124;                   2 &#124;                 0.2 &#124;                     12 &#124;
&#124; innodb_pages_written              &#124; 38429812         &#124; 38430032         &#124;                 220 &#124;                  22 &#124;                   1320 &#124;
&#124; innodb_rows_deleted               &#124; 6849552          &#124; 6849568          &#124;                  16 &#124;                 1.6 &#124;                     96 &#124;
&#124; innodb_rows_inserted              &#124; 43787980         &#124; 43788207         &#124;                 227 &#124;                22.7 &#124;                   1362 &#124;
&#124; innodb_rows_read                  &#124; 4289845136       &#124; 4289919560       &#124;               74424 &#124;              7442.4 &#124;                 446544 &#124;
&#124; innodb_rows_updated               &#124; 24119627         &#124; 24119809         &#124;                 182 &#124;                18.2 &#124;                   1092 &#124;
&#124; key_read_requests                 &#124; 41262330         &#124; 41262338         &#124;                   8 &#124;                 0.8 &#124;                     48 &#124;
&#124; open_files                        &#124; 7                &#124; 5                &#124;                  -2 &#124;                -0.2 &#124;                    -12 &#124;
&#124; opened_files                      &#124; 4212920          &#124; 4212924          &#124;                   4 &#124;                 0.4 &#124;                     24 &#124;
&#124; questions                         &#124; 253158874        &#124; 253160331        &#124;                1457 &#124;               145.7 &#124;                   8742 &#124;
&#124; select_full_join                  &#124; 546              &#124; 547              &#124;                   1 &#124;                 0.1 &#124;                      6 &#124;
&#124; select_range                      &#124; 721945           &#124; 721947           &#124;                   2 &#124;                 0.2 &#124;                     12 &#124;
&#124; select_scan                       &#124; 12828865         &#124; 12828989         &#124;                 124 &#124;                12.4 &#124;                    744 &#124;
&#124; sort_range                        &#124; 170971           &#124; 170973           &#124;                   2 &#124;                 0.2 &#124;                     12 &#124;
&#124; sort_rows                         &#124; 255175383        &#124; 255176655        &#124;                1272 &#124;               127.2 &#124;                   7632 &#124;
&#124; sort_scan                         &#124; 534078           &#124; 534080           &#124;                   2 &#124;                 0.2 &#124;                     12 &#124;
&#124; table_locks_immediate             &#124; 142673687        &#124; 142674454        &#124;                 767 &#124;                76.7 &#124;                   4602 &#124;
&#124; threads_cached                    &#124; 7                &#124; 8                &#124;                   1 &#124;                 0.1 &#124;                      6 &#124;
&#124; threads_connected                 &#124; 5                &#124; 10               &#124;                   5 &#124;                 0.5 &#124;                     30 &#124;
&#124; threads_created                   &#124; 840486           &#124; 840509           &#124;                  23 &#124;                 2.3 &#124;                    138 &#124;
+-----------------------------------+------------------+------------------+---------------------+---------------------+------------------------+

Some values don&#8217;t make sense to do difference on (e.g. threads_connected), since they present with momentary status and are not incrementing as others (e.g. threads_created).
Happy SQLing!]]></description>
			<content:encoded><![CDATA[<p>Have just read <a href="http://karlssonondatabases.blogspot.com/2011/08/mysql-global-status-difference-using_12.html">MySQL Global status difference using MySQL procedures / functions</a>, by Andres Karlsson. Have commented, but realized I did not provide with a direct answer. In the comment, I suggested checking out <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/global_status_diff.html">a solution based on views</a>, found in <a rel="nofollow" href="http://code.google.com/p/common-schema/">common_schema</a>. But the solution in <em>common_schema</em> is split into two views, due to the fact views cannot handle derived tables subqueries.</p>
<p>Well, here&#8217;s a single query to do that: it checks <strong>GLOBAL_STATUS</strong> twice, <strong>10</strong> seconds apart in the following sample. It uses <strong>SLEEP()</strong> to actually wait between the two reads. Yes, you can do that with a query.</p>
<p>The following query shows all <strong>GLOBAL_STATUS</strong> values that have changed during the sample period.<span></span></p>
<blockquote>
<pre>SELECT STRAIGHT_JOIN
   LOWER(gs0.VARIABLE_NAME) AS variable_name,
   gs0.VARIABLE_VALUE AS variable_value_0,
   gs1.VARIABLE_VALUE AS variable_value_1,
   (gs1.VARIABLE_VALUE - gs0.VARIABLE_VALUE) AS variable_value_diff,
   (gs1.VARIABLE_VALUE - gs0.VARIABLE_VALUE) / 10 AS variable_value_psec,
   (gs1.VARIABLE_VALUE - gs0.VARIABLE_VALUE) * 60 / 10 AS
variable_value_pminute
FROM
   (
     SELECT
       VARIABLE_NAME,
       VARIABLE_VALUE
     FROM
       INFORMATION_SCHEMA.GLOBAL_STATUS
     UNION ALL
     SELECT
       '',
       SLEEP(10)
     FROM DUAL
   ) AS gs0
   JOIN INFORMATION_SCHEMA.GLOBAL_STATUS gs1 USING (VARIABLE_NAME)
WHERE
   gs1.VARIABLE_VALUE != gs0.VARIABLE_VALUE
;
+-----------------------------------+------------------+------------------+---------------------+---------------------+------------------------+
| variable_name                     | variable_value_0 | variable_value_1 | variable_value_diff | variable_value_psec | variable_value_pminute |
+-----------------------------------+------------------+------------------+---------------------+---------------------+------------------------+
| aborted_clients                   | 2210669          | 2210686          |                  17 |                 1.7 |                    102 |
| bytes_received                    | 53259933210      | 53260211104      |              277894 |             27789.4 |                1667364 |
| bytes_sent                        | 351130988015     | 351132884956     |             1896941 |            189694.1 |               11381646 |
| com_change_db                     | 3760546          | 3760584          |                  38 |                 3.8 |                    228 |
| com_delete                        | 6774784          | 6774801          |                  17 |                 1.7 |                    102 |
| com_insert                        | 52743750         | 52744012         |                 262 |                26.2 |                   1572 |
| com_insert_select                 | 13362650         | 13362740         |                  90 |                   9 |                    540 |
| com_select                        | 51722818         | 51723107         |                 289 |                28.9 |                   1734 |
| com_set_option                    | 108564134        | 108564754        |                 620 |                  62 |                   3720 |
| com_show_collations               | 3760530          | 3760568          |                  38 |                 3.8 |                    228 |
| com_show_processlist              | 366078           | 366082           |                   4 |                 0.4 |                     24 |
| com_show_status                   | 366047           | 366051           |                   4 |                 0.4 |                     24 |
| com_show_variables                | 3760535          | 3760573          |                  38 |                 3.8 |                    228 |
| com_update                        | 6271283          | 6271324          |                  41 |                 4.1 |                    246 |
| connections                       | 3781382          | 3781420          |                  38 |                 3.8 |                    228 |
| created_tmp_disk_tables           | 983223           | 983224           |                   1 |                 0.1 |                      6 |
| created_tmp_tables                | 9134044          | 9134126          |                  82 |                 8.2 |                    492 |
| handler_commit                    | 125798040        | 125798688        |                 648 |                64.8 |                   3888 |
| handler_delete                    | 6849562          | 6849578          |                  16 |                 1.6 |                     96 |
| handler_read_first                | 5332451          | 5332498          |                  47 |                 4.7 |                    282 |
| handler_read_key                  | 373910509        | 373912469        |                1960 |                 196 |                  11760 |
| handler_read_next                 | 850122025        | 850170403        |               48378 |              4837.8 |                 290268 |
| handler_read_rnd                  | 255104660        | 255105932        |                1272 |               127.2 |                   7632 |
| handler_read_rnd_next             | 992505444        | 992549948        |               44504 |              4450.4 |                 267024 |
| handler_update                    | 27930283         | 27930465         |                 182 |                18.2 |                   1092 |
| handler_write                     | 2051582925       | 2051602416       |               19491 |              1949.1 |                 116946 |
| innodb_buffer_pool_pages_data     | 77232            | 77243            |                  11 |                 1.1 |                     66 |
| innodb_buffer_pool_pages_dirty    | 626              | 645              |                  19 |                 1.9 |                    114 |
| innodb_buffer_pool_pages_flushed  | 38429812         | 38430032         |                 220 |                  22 |                   1320 |
| innodb_buffer_pool_pages_misc     | 4294922063       | 4294922052       |                 -11 |                -1.1 |                    -66 |
| innodb_buffer_pool_read_requests  | 1933796064       | 1933871603       |               75539 |              7553.9 |                 453234 |
| innodb_buffer_pool_reads          | 11360212         | 11360214         |                   2 |                 0.2 |                     12 |
| innodb_buffer_pool_write_requests | 1074109722       | 1074115394       |                5672 |               567.2 |                  34032 |
| innodb_data_fsyncs                | 5583880          | 5583905          |                  25 |                 2.5 |                    150 |
| innodb_data_read                  | 3339489280       | 3339501568       |               12288 |              1228.8 |                  73728 |
| innodb_data_reads                 | 11796492         | 11796494         |                   2 |                 0.2 |                     12 |
| innodb_data_writes                | 105587582        | 105588145        |                 563 |                56.3 |                   3378 |
| innodb_data_written               | 3721600000       | 3727315968       |             5715968 |            571596.8 |               34295808 |
| innodb_dblwr_pages_written        | 38429812         | 38430032         |                 220 |                  22 |                   1320 |
| innodb_dblwr_writes               | 596503           | 596506           |                   3 |                 0.3 |                     18 |
| innodb_log_write_requests         | 380978894        | 380981368        |                2474 |               247.4 |                  14844 |
| innodb_log_writes                 | 74407604         | 74407990         |                 386 |                38.6 |                   2316 |
| innodb_os_log_fsyncs              | 2310799          | 2310807          |                   8 |                 0.8 |                     48 |
| innodb_os_log_written             | 2905292800       | 2906502656       |             1209856 |            120985.6 |                7259136 |
| innodb_pages_created              | 1341584          | 1341593          |                   9 |                 0.9 |                     54 |
| innodb_pages_read                 | 13117652         | 13117654         |                   2 |                 0.2 |                     12 |
| innodb_pages_written              | 38429812         | 38430032         |                 220 |                  22 |                   1320 |
| innodb_rows_deleted               | 6849552          | 6849568          |                  16 |                 1.6 |                     96 |
| innodb_rows_inserted              | 43787980         | 43788207         |                 227 |                22.7 |                   1362 |
| innodb_rows_read                  | 4289845136       | 4289919560       |               74424 |              7442.4 |                 446544 |
| innodb_rows_updated               | 24119627         | 24119809         |                 182 |                18.2 |                   1092 |
| key_read_requests                 | 41262330         | 41262338         |                   8 |                 0.8 |                     48 |
| open_files                        | 7                | 5                |                  -2 |                -0.2 |                    -12 |
| opened_files                      | 4212920          | 4212924          |                   4 |                 0.4 |                     24 |
| questions                         | 253158874        | 253160331        |                1457 |               145.7 |                   8742 |
| select_full_join                  | 546              | 547              |                   1 |                 0.1 |                      6 |
| select_range                      | 721945           | 721947           |                   2 |                 0.2 |                     12 |
| select_scan                       | 12828865         | 12828989         |                 124 |                12.4 |                    744 |
| sort_range                        | 170971           | 170973           |                   2 |                 0.2 |                     12 |
| sort_rows                         | 255175383        | 255176655        |                1272 |               127.2 |                   7632 |
| sort_scan                         | 534078           | 534080           |                   2 |                 0.2 |                     12 |
| table_locks_immediate             | 142673687        | 142674454        |                 767 |                76.7 |                   4602 |
| threads_cached                    | 7                | 8                |                   1 |                 0.1 |                      6 |
| threads_connected                 | 5                | 10               |                   5 |                 0.5 |                     30 |
| threads_created                   | 840486           | 840509           |                  23 |                 2.3 |                    138 |
+-----------------------------------+------------------+------------------+---------------------+---------------------+------------------------+</pre>
</blockquote>
<p>Some values don&#8217;t make sense to do difference on (e.g. <strong>threads_connected</strong>), since they present with momentary status and are not incrementing as others (e.g. <strong>threads_created</strong>).</p>
<p>Happy SQLing!</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=29689&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=29689&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2011/08/12/mysql-global-status-difference-using-single-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing common_schema: common views &amp; routines for MySQL</title>
		<link>http://code.openark.org/blog/mysql/announcing-common_schema-common-views-routines-for-mysql?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=announcing-common_schema-common-views-routines-for-mysql</link>
		<comments>http://code.openark.org/blog/mysql/announcing-common_schema-common-views-routines-for-mysql#comments</comments>
		<pubDate>Wed, 13 Jul 2011 04:25:48 +0000</pubDate>
		<dc:creator>Shlomi Noach</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[common_schema]]></category>
		<category><![CDATA[data-types]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[indexing]]></category>
		<category><![CDATA[information_schema]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[stored routines]]></category>

		<guid isPermaLink="false">http://code.openark.org/blog/?p=3794</guid>
		<description><![CDATA[Today I have released common_schema, a utility schema for MySQL which includes many views and functions, and is aimed to be installed on any MySQL server.
What does it do?
There are views answering for all sorts of useful information: stuff related to schema analysis, data dimensions, monitoring, processes &#38; transactions, security, internals&#8230; There are basic functions answering for common needs.
Some of the views/routines simply formalize those queries we tend to write over and over again. Others take the place of external tools, answering complex questions via SQL and metadata. Still others help out with SQL generation.
Here are a few highlights:

Did you know you can work out simple monitoring of your server with a query?  There&#8217;s a view to do that for you.
How about showing just the good parts of the processlist?
Does your schema have redundant keys?
Or InnoDB tables with no PRIMARY KEY?
Is AUTO_INCREMENT running out of space?
Can I get the SQL statements to generate my FOREIGN KEYs? To drop them?
And can we finally get SHOW GRANTS for all accounts, and as an SQL query?
Ever needed a 64 bit CRC function?
And aren&#8217;t you tired of writing the cumbersome SUBSTRING_INDEX(SUBSTRING_INDEX(str, &#8216;,&#8217;, 3), &#8216;,&#8217;, -1)? There&#8217;s an alternative.

There&#8217;s more. Take a look at the common_schema documentation for full listing. And it&#8217;s evolving: I&#8217;ve got quite a few ideas already for future components.
Some of these views rely on heavyweight INFORMATION_SCHEMA tables. You should be aware of the impact and risks.
What do I need to install?
There&#8217;s no script or executable file. It&#8217;s just a schema. The distribution in an SQL file which generates common_schema. Much like a dump file.
What are the system requirements?
It&#8217;s just between you and your MySQL. There are currently three distribution files, dedicated for different versions of MySQL (and allowing for increased functionality):

common_schema_mysql_51: fits all MySQL &#62;= 5.1 distributions
common_schema_innodb_plugin: fits MySQL &#62;= 5.1, with InnoDB plugin + INFORMATION_SCHEMA tables enabled
common_schema_percona_server: fits Percona Server &#62;= 5.1

Refer to the documentation for more details.
What are the terms of use?
common_schema is released under the BSD license.
Where can I download it?
On the common_schema project page. Enjoy it!]]></description>
			<content:encoded><![CDATA[<p>Today I have released <a title="common_schema" href="http://code.openark.org/forge/common_schema">common_schema</a>, a utility schema for MySQL which includes many views and functions, and is aimed to be installed on any MySQL server.</p>
<h4>What does it do?</h4>
<p>There are views answering for all sorts of useful information: stuff related to schema analysis, data dimensions, monitoring, processes &amp; transactions, security, internals&#8230; There are basic functions answering for common needs.</p>
<p>Some of the views/routines simply formalize those queries we tend to write over and over again. Others take the place of external tools, answering complex questions via SQL and metadata. Still others help out with SQL generation.</p>
<p>Here are a few highlights:</p>
<ul>
<li>Did you know you can work out <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/global_status_diff_nonzero.html">simple monitoring</a> of your server with a <em>query</em>?  There&#8217;s a view to do that for you.</li>
<li>How about showing just <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/processlist_top.html">the good parts of the processlist</a>?</li>
<li>Does your schema have <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/redundant_keys.html">redundant keys</a>?</li>
<li>Or InnoDB tables with <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/no_pk_innodb_tables.html">no PRIMARY KEY</a>?</li>
<li>Is AUTO_INCREMENT <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/auto_increment_columns.html">running out of space</a>?</li>
<li>Can I get the SQL statements to <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/sql_foreign_keys.html">generate my FOREIGN KEYs</a>? To drop them?</li>
<li>And can we finally get <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/sql_show_grants.html">SHOW GRANTS for all accounts</a>, and as an <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/sql_grants.html">SQL query</a>?</li>
<li>Ever needed a <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/general_functions.html#crc64">64 bit CRC function</a>?</li>
<li>And aren&#8217;t you tired of writing the cumbersome SUBSTRING_INDEX(SUBSTRING_INDEX(str, &#8216;,&#8217;, 3), &#8216;,&#8217;, -1)? <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/string_functions.html#split_token">There&#8217;s an alternative</a>.</li>
</ul>
<p>There&#8217;s more. Take a look at the <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/introduction.html">common_schema documentation</a> for full listing. And it&#8217;s evolving: I&#8217;ve got quite a few ideas already for future components.</p>
<p>Some of these views rely on heavyweight INFORMATION_SCHEMA tables. You should be aware of the impact and <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/risks.html">risks</a>.</p>
<h4>What do I need to install?</h4>
<p>There&#8217;s no script or executable file. It&#8217;s just a schema. The distribution in an SQL file which generates <em>common_schema</em>. Much like a dump file.</p>
<h4><span></span>What are the system requirements?</h4>
<p>It&#8217;s just between you and your MySQL. There are currently three distribution files, dedicated for different versions of MySQL (and allowing for increased functionality):</p>
<ul>
<li><strong>common_schema_mysql_51</strong>: fits all MySQL &gt;= 5.1 distributions</li>
<li><strong>common_schema_innodb_plugin</strong>: fits MySQL &gt;= 5.1, with InnoDB plugin + INFORMATION_SCHEMA tables enabled</li>
<li><strong>common_schema_percona_server</strong>: fits Percona Server &gt;= 5.1</li>
</ul>
<p>Refer to the <a rel="nofollow" href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/download.html">documentation</a> for more details.</p>
<h4>What are the terms of use?</h4>
<p><em>common_schema</em> is released under the <a href="http://www.opensource.org/licenses/bsd-license.php">BSD license</a>.</p>
<h4>Where can I download it?</h4>
<p>On the <a href="http://code.google.com/p/common-schema/">common_schema project page</a>. Enjoy it!</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=29330&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=29330&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2011/07/13/announcing-common_schema-common-views-routines-for-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing common_schema: common views &amp; routines for MySQL</title>
		<link>http://code.openark.org/blog/mysql/announcing-common_schema-common-views-routines-for-mysql?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=announcing-common_schema-common-views-routines-for-mysql</link>
		<comments>http://code.openark.org/blog/mysql/announcing-common_schema-common-views-routines-for-mysql#comments</comments>
		<pubDate>Wed, 13 Jul 2011 04:25:48 +0000</pubDate>
		<dc:creator>Shlomi Noach</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[common_schema]]></category>
		<category><![CDATA[data-types]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[indexing]]></category>
		<category><![CDATA[information_schema]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[stored routines]]></category>

		<guid isPermaLink="false">http://code.openark.org/blog/?p=3794</guid>
		<description><![CDATA[Today I have released common_schema, a utility schema for MySQL which includes many views and functions, and is aimed to be installed on any MySQL server.
What does it do?
There are views answering for all sorts of useful information: stuff related to schema analysis, data dimensions, monitoring, processes &#38; transactions, security, internals&#8230; There are basic functions answering for common needs.
Some of the views/routines simply formalize those queries we tend to write over and over again. Others take the place of external tools, answering complex questions via SQL and metadata. Still others help out with SQL generation.
Here are a few highlights:

Did you know you can work out simple monitoring of your server with a query?  There&#8217;s a view to do that for you.
How about showing just the good parts of the processlist?
Does your schema have redundant keys?
Or InnoDB tables with no PRIMARY KEY?
Is AUTO_INCREMENT running out of space?
Can I get the SQL statements to generate my FOREIGN KEYs? To drop them?
And can we finally get SHOW GRANTS for all accounts, and as an SQL query?
Ever needed a 64 bit CRC function?
And aren&#8217;t you tired of writing the cumbersome SUBSTRING_INDEX(SUBSTRING_INDEX(str, &#8216;,&#8217;, 3), &#8216;,&#8217;, -1)? There&#8217;s an alternative.

There&#8217;s more. Take a look at the common_schema documentation for full listing. And it&#8217;s evolving: I&#8217;ve got quite a few ideas already for future components.
Some of these views rely on heavyweight INFORMATION_SCHEMA tables. You should be aware of the impact and risks.
What do I need to install?
There&#8217;s no script or executable file. It&#8217;s just a schema. The distribution in an SQL file which generates common_schema. Much like a dump file.
What are the system requirements?
It&#8217;s just between you and your MySQL. There are currently three distribution files, dedicated for different versions of MySQL (and allowing for increased functionality):

common_schema_mysql_51: fits all MySQL &#62;= 5.1 distributions
common_schema_innodb_plugin: fits MySQL &#62;= 5.1, with InnoDB plugin + INFORMATION_SCHEMA tables enabled
common_schema_percona_server: fits Percona Server &#62;= 5.1

Refer to the documentation for more details.
What are the terms of use?
common_schema is released under the BSD license.
Where can I download it?
On the common_schema project page. Enjoy it!]]></description>
			<content:encoded><![CDATA[<p>Today I have released <a title="common_schema" href="http://code.openark.org/forge/common_schema">common_schema</a>, a utility schema for MySQL which includes many views and functions, and is aimed to be installed on any MySQL server.</p>
<h4>What does it do?</h4>
<p>There are views answering for all sorts of useful information: stuff related to schema analysis, data dimensions, monitoring, processes &amp; transactions, security, internals&#8230; There are basic functions answering for common needs.</p>
<p>Some of the views/routines simply formalize those queries we tend to write over and over again. Others take the place of external tools, answering complex questions via SQL and metadata. Still others help out with SQL generation.</p>
<p>Here are a few highlights:</p>
<ul>
<li>Did you know you can work out <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/global_status_diff_nonzero.html">simple monitoring</a> of your server with a <em>query</em>?  There&#8217;s a view to do that for you.</li>
<li>How about showing just <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/processlist_top.html">the good parts of the processlist</a>?</li>
<li>Does your schema have <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/redundant_keys.html">redundant keys</a>?</li>
<li>Or InnoDB tables with <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/no_pk_innodb_tables.html">no PRIMARY KEY</a>?</li>
<li>Is AUTO_INCREMENT <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/auto_increment_columns.html">running out of space</a>?</li>
<li>Can I get the SQL statements to <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/sql_foreign_keys.html">generate my FOREIGN KEYs</a>? To drop them?</li>
<li>And can we finally get <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/sql_show_grants.html">SHOW GRANTS for all accounts</a>, and as an <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/sql_grants.html">SQL query</a>?</li>
<li>Ever needed a <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/general_functions.html#crc64">64 bit CRC function</a>?</li>
<li>And aren&#8217;t you tired of writing the cumbersome SUBSTRING_INDEX(SUBSTRING_INDEX(str, &#8216;,&#8217;, 3), &#8216;,&#8217;, -1)? <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/string_functions.html#split_token">There&#8217;s an alternative</a>.</li>
</ul>
<p>There&#8217;s more. Take a look at the <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/introduction.html">common_schema documentation</a> for full listing. And it&#8217;s evolving: I&#8217;ve got quite a few ideas already for future components.</p>
<p>Some of these views rely on heavyweight INFORMATION_SCHEMA tables. You should be aware of the impact and <a href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/risks.html">risks</a>.</p>
<h4>What do I need to install?</h4>
<p>There&#8217;s no script or executable file. It&#8217;s just a schema. The distribution in an SQL file which generates <em>common_schema</em>. Much like a dump file.</p>
<h4><span></span>What are the system requirements?</h4>
<p>It&#8217;s just between you and your MySQL. There are currently three distribution files, dedicated for different versions of MySQL (and allowing for increased functionality):</p>
<ul>
<li><strong>common_schema_mysql_51</strong>: fits all MySQL &gt;= 5.1 distributions</li>
<li><strong>common_schema_innodb_plugin</strong>: fits MySQL &gt;= 5.1, with InnoDB plugin + INFORMATION_SCHEMA tables enabled</li>
<li><strong>common_schema_percona_server</strong>: fits Percona Server &gt;= 5.1</li>
</ul>
<p>Refer to the <a rel="nofollow" href="http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/download.html">documentation</a> for more details.</p>
<h4>What are the terms of use?</h4>
<p><em>common_schema</em> is released under the <a href="http://www.opensource.org/licenses/bsd-license.php">BSD license</a>.</p>
<h4>Where can I download it?</h4>
<p>On the <a href="http://code.google.com/p/common-schema/">common_schema project page</a>. Enjoy it!</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=29330&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=29330&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2011/07/13/announcing-common_schema-common-views-routines-for-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the best of Clouds, Internet and BI</title>
		<link>http://karlssonondatabases.blogspot.com/2011/04/getting-best-of-clouds-internet-and-bi.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-the-best-of-clouds-internet-and-bi</link>
		<comments>http://karlssonondatabases.blogspot.com/2011/04/getting-best-of-clouds-internet-and-bi.html#comments</comments>
		<pubDate>Mon, 11 Apr 2011 01:27:24 +0000</pubDate>
		<dc:creator>Anders Karlsson</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[BI]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The internet really is full of stuff, and we are starting to fill the Clouds with all sorts of software that moves from the serverrooms and in to the clouds. One aspect here that is often missing is what a Cloud environment and the Internet in itself can add to what we already know and have. Or in other words, running in the cloud is not only about lowering costs, and if you look at it by lowering costs by running things in the cloud the same way you used to run it on your private server, then chances are you might not gain anything, running in a cloud is also about having distinct advantages not easily available somewhere else.Christopher Ahlberg here are Recorded Future just blogged about another way of looking at it: What do we have access to on the internet that is not readily available in the Server room, and the answer is: data. A lot of data. For someone in the field of BI, not using Internet data, and sticking to traditional querterly results as the base for analysis, is really missing the point.Read Christophers blog here for the full Monty (!). This is an interesting perspective, and way you look at it, and as an amateur computer historial, this is particularily interesting as one of the few commercial uses for the worlds probably only useful hydralic computer was just this: Using analysis to project sales. (This is actually largely true. Feel freee to ask me more on this last subject at the upcoming MySQL UC. This is truly weird geeky history!)./Karlsson]]></description>
			<content:encoded><![CDATA[The internet really is full of stuff, and we are starting to fill the Clouds with all sorts of software that moves from the serverrooms and in to the clouds. One aspect here that is often missing is what a Cloud environment and the Internet in itself can add to what we already know and have. Or in other words, running in the cloud is not only about lowering costs, and if you look at it by lowering costs by running things in the cloud the same way you used to run it on your private server, then chances are you might not gain anything, running in a cloud is also about having distinct advantages not easily available somewhere else.<br /><br />Christopher Ahlberg here are Recorded Future just blogged about another way of looking at it: What do we have access to on the internet that is not readily available in the Server room, and the answer is: data. A lot of data. For someone in the field of BI, not using Internet data, and sticking to traditional querterly results as the base for analysis, is really missing the point.<br /><br />Read Christophers blog <a href="http://blog.recordedfuture.com/2011/04/10/business-intelligence-in-the-cloud-when-the-internet-is-the-data-source/">here</a> for the full Monty (!). This is an interesting perspective, and way you look at it, and as an amateur computer historial, this is particularily interesting as one of the few commercial uses for the worlds probably only useful hydralic computer was just this: Using analysis to project sales. (This is actually largely true. Feel freee to ask me more on this last subject at the upcoming MySQL UC. This is truly weird geeky history!).<br /><br />/Karlsson<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/9144505959002328789-5060054172797816526?l=karlssonondatabases.blogspot.com" alt="" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=27959&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=27959&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2011/04/11/getting-the-best-of-clouds-internet-and-bi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>openark-kit (rev. 170): new tools, new functionality</title>
		<link>http://code.openark.org/blog/mysql/openark-kit-rev-170-new-tools-new-functionality?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=openark-kit-rev-170-new-tools-new-functionality</link>
		<comments>http://code.openark.org/blog/mysql/openark-kit-rev-170-new-tools-new-functionality#comments</comments>
		<pubDate>Wed, 15 Dec 2010 06:31:24 +0000</pubDate>
		<dc:creator>Shlomi Noach</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[openark kit]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Replication]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://code.openark.org/blog/?p=3124</guid>
		<description><![CDATA[I&#8217;m please to announce a new release of the openark kit. There&#8217;s a lot of new functionality inside; following is a brief overview.
The openark kit is a set of utilities for MySQL. They  solve everyday maintenance tasks, which may be complicated or time  consuming to work by hand.
It&#8217;s been a while since the last announced release. Most of my attention was on mycheckpoint, building new features, writing documentation etc. However my own use of openark kit has only increased in the past few months, and there&#8217;s new useful solutions to common problems that have been developed.
I&#8217;ve used and improved many tools over this time, but doing the final cut, along with proper documentation, took some time. Anyway, here are the highlights:
New tool: oak-hook-general-log
oak-hook-general-log hooks up a MySQL server and dumps the general log based on filtering rules, applying to query role or execution plan. It is possible to only dump connect/disconnect entries, queries which make a full table scan, or use temporary tables, or scan more than X number of rows, or&#8230;
I&#8217;ll write more on this tool shortly.
New tool: oak-prepare-shutdown
This tool makes for an orderly and faster shutdown by safely stopping replication, and flushing InnoDB pages to disk prior to shutting down (keeping server available for connections even while attempting to flush dirty pages to disk). A typical use case would be:

oak-prepare-shutdown --user=root --ask-pass --socket=/tmp/mysql.sock &#38;&#38; /etc/init.d/mysql stop

New tool: oak-repeat query
oak-repeat-query repeats executing a given query until some condition holds. The condition can be:

Number of given iterations has been reached
Given time has elapsed
No rows have been affected by query

The tool comes in handy for cleanup jobs, warming up caches, etc.
New tool: oak-get-slave-lag
This simple tool just returns the number of seconds a slave is behind master. But it also returns with an appropriate exit code, based on a given threshold: 0 when lag is good, 1 (error exit code) when lag is too great or slave fails to replicate.
This tool has been used by 3rd party applications, such as a load balancer, to determine whether a slave should be accessed.
Updated tool: oak-chunk-update
This extremely useful utility breaks down very long queries into smaller chunks. These could be queries which should affect a huge amount of rows, or queries which cannot utilize an index.
Updates to the tool include limiting the range of rows the tool scans, by specifying start and stop position (either by providing constant values or by SELECT query). Also added is auto-termination when no rows are found to be affected. Last, it is possible to override INFORMATION_SCHEMA lookup by explicitly specifying chunking key.
This tool works great for your daily/weekly/monthly batch jobs; in creating DWH tables; populating new columns; purging old entries; clearing data based on non-indexed values; generating summary tables; and more.
Frozen tool: oak-apply-ri
I haven&#8217;t been using this tool for a while. The main work down by this tool can be done with oak-chunk-update. There are some additional safety checks oak-apply-ri provides; I&#8217;m thinking over if they justify the tool&#8217;s existence.
Frozen tool: oak-online-alter-table
With the appearance of Facebook’s Online Schema Change (OSC) tool, which derives from oak-online-alter-table, I&#8217;m not sure I will continue developing the tool. I intend to wait for general feedback on OSC before making a decision.
Documentation
Documentation is now part of openark kit&#8216;s SVN repository.
Download
The openark kit project is currently hosted by Google Code.  Downloads are available at the Google Code openark kit project page.
Downloads are available in the following packaging formats:

.deb package, to be installed on debian, ubuntu and otherwise debian based distributions.
.rpm package, architecture free (noarch), for RPM supporting Linux distributions such as RedHat, Fedora, CentOS etc.
.tar.gz using python&#8217;s distutils installer.
source, directly retrieved from SVN or from above python package.
Some distribution specific RPM packages, courtesy Lenz Grimmer.

Feedback
Your feedback is welcome! I may not always respond promptly; and I confess that some bugs were left open for more than I would have liked them to. I hope to make for good quality of code, and bug reporting is one major factor you can control.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m please to announce a new release of the <a href="http://code.openark.org/forge/openark-kit">openark kit</a>. There&#8217;s a lot of new functionality inside; following is a brief overview.</p>
<p>The <em>openark kit</em> is a set of utilities for MySQL. They  solve everyday maintenance tasks, which may be complicated or time  consuming to work by hand.</p>
<p>It&#8217;s been a while since the last announced release. Most of my attention was on <a href="http://code.openark.org/forge/mycheckpoint">mycheckpoint</a>, building new features, writing documentation etc. However my own use of <em>openark kit</em> has only increased in the past few months, and there&#8217;s new useful solutions to common problems that have been developed.</p>
<p>I&#8217;ve used and improved many tools over this time, but doing the final cut, along with proper documentation, took some time. Anyway, here are the highlights:</p>
<h4>New tool: oak-hook-general-log</h4>
<p><em>oak-hook-general-log</em> hooks up a MySQL server and dumps the general log based on filtering rules, applying to query role or execution plan. It is possible to only dump connect/disconnect entries, queries which make a full table scan, or use temporary tables, or scan more than X number of rows, or&#8230;</p>
<p>I&#8217;ll write more on this tool shortly.</p>
<h4>New tool: oak-prepare-shutdown</h4>
<p>This tool makes for an orderly and faster shutdown by safely stopping replication, and flushing InnoDB pages to disk prior to shutting down (keeping server available for connections even while attempting to flush dirty pages to disk). A typical use case would be:</p>
<blockquote>
<pre>oak-prepare-shutdown --user=root --ask-pass --socket=/tmp/mysql.sock &amp;&amp; /etc/init.d/mysql stop</pre>
</blockquote>
<h4>New tool: oak-repeat query</h4>
<p><em>oak-repeat-query</em> repeats executing a given query until some condition holds. The condition can be:</p>
<ul>
<li>Number of given iterations has been reached</li>
<li>Given time has elapsed</li>
<li>No rows have been affected by query</li>
</ul>
<p>The tool comes in handy for cleanup jobs, warming up caches, etc.<span></span></p>
<h4>New tool: oak-get-slave-lag</h4>
<p>This simple tool just returns the number of seconds a slave is behind master. But it also returns with an appropriate exit code, based on a given threshold: <strong>0</strong> when lag is good, <strong>1</strong> (error exit code) when lag is too great or slave fails to replicate.</p>
<p>This tool has been used by 3rd party applications, such as a load balancer, to determine whether a slave should be accessed.</p>
<h4>Updated tool: oak-chunk-update</h4>
<p>This extremely useful utility breaks down very long queries into smaller chunks. These could be queries which should affect a huge amount of rows, or queries which cannot utilize an index.</p>
<p>Updates to the tool include limiting the range of rows the tool scans, by specifying start and stop position (either by providing constant values or by SELECT query). Also added is auto-termination when no rows are found to be affected. Last, it is possible to override INFORMATION_SCHEMA lookup by explicitly specifying chunking key.</p>
<p>This tool works great for your daily/weekly/monthly batch jobs; in creating DWH tables; populating new columns; purging old entries; clearing data based on non-indexed values; generating summary tables; and more.</p>
<h4>Frozen tool: oak-apply-ri</h4>
<p>I haven&#8217;t been using this tool for a while. The main work down by this tool can be done with <em>oak-chunk-update</em>. There are some additional safety checks <em>oak-apply-ri</em> provides; I&#8217;m thinking over if they justify the tool&#8217;s existence.</p>
<h4>Frozen tool: oak-online-alter-table</h4>
<p>With the appearance of Facebook’s <a href="http://www.facebook.com/note.php?note_id=430801045932">Online Schema Change</a> (OSC) tool, which derives from <em>oak-online-alter-table</em>, I&#8217;m not sure I will continue developing the tool. I intend to wait for general feedback on OSC before making a decision.</p>
<h4>Documentation</h4>
<p><a href="http://openarkkit.googlecode.com/svn/trunk/openarkkit/doc/html/introduction.html">Documentation</a> is now part of <em>openark kit</em>&#8216;s SVN repository.</p>
<h4>Download</h4>
<p>The <em>openark kit</em> project is currently hosted by Google Code.  Downloads are available at the Google Code <a href="http://code.google.com/p/openarkkit/">openark kit project page</a>.</p>
<p>Downloads are available in the following packaging formats:</p>
<ul>
<li><strong>.deb</strong> package, to be installed on <em>debian</em>, <em>ubuntu</em> and otherwise debian based distributions.</li>
<li><strong>.rpm</strong> package, architecture free (<em>noarch</em>), for RPM supporting Linux distributions such as <em>RedHat</em>, <em>Fedora</em>, <em>CentOS</em> etc.</li>
<li><strong>.tar.gz</strong> using python&#8217;s distutils installer.</li>
<li><strong>source</strong>, directly retrieved from SVN or from above python package.</li>
<li>Some distribution specific <a href="http://software.opensuse.org/search?baseproject=ALL&amp;p=1&amp;q=openark-kit">RPM packages</a>, courtesy Lenz Grimmer.</li>
</ul>
<h4>Feedback</h4>
<p>Your feedback is welcome! I may not always respond promptly; and I confess that some bugs were left open for more than I would have liked them to. I hope to make for good quality of code, and bug reporting is one major factor you can control.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=26742&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=26742&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/12/15/openark-kit-rev-170-new-tools-new-functionality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dbbenchmark.com – now supporting MySQL on OSX 10.6</title>
		<link>http://www.dbbenchmark.com/wordpress/2010/08/29/dbbenchmark-com-now-supporting-mysql-on-osx-10-6/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dbbenchmark-com-%25e2%2580%2593-now-supporting-mysql-on-osx-10-6</link>
		<comments>http://www.dbbenchmark.com/wordpress/2010/08/29/dbbenchmark-com-now-supporting-mysql-on-osx-10-6/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 04:47:43 +0000</pubDate>
		<dc:creator>Matt Reid</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql server]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dbbenchmark.com/wordpress/?p=74</guid>
		<description><![CDATA[Just a quick note to let everyone know that our new benchmarking script now supports OSX 10.6 on Intel hardware. That means you can run one simple command and get all of the sequential and random INSERT and SELECT performance statistics about your database performance. As usual the script is open source and released under the new BSD license. Give is a try by downloading now! See the download page for more details. ]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to let everyone know that our new benchmarking script now supports OSX 10.6 on Intel hardware. That means you can run one simple command and get all of the sequential and random INSERT and SELECT performance statistics about your database performance. As usual the script is open source and released under the new BSD license. Give is a try by downloading now! See <a href="http://www.dbbenchmark.com/wordpress/download/">the download page</a> for more details. </p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25698&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25698&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/08/29/dbbenchmark-com-%e2%80%93-now-supporting-mysql-on-osx-10-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dbbenchmark.com – Benchmarking script now available</title>
		<link>http://www.dbbenchmark.com/wordpress/2010/08/28/benchmarking-script-now-available/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dbbenchmark-com-%25e2%2580%2593-benchmarking-script-now-available</link>
		<comments>http://www.dbbenchmark.com/wordpress/2010/08/28/benchmarking-script-now-available/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 00:34:09 +0000</pubDate>
		<dc:creator>Matt Reid</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql server]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dbbenchmark.com/wordpress/?p=42</guid>
		<description><![CDATA[You can download the first release of the benchmarking script here: http://code.google.com/p/dbbenchmark/
Please read the README file or consult the Support page before running the benchmarks.]]></description>
			<content:encoded><![CDATA[<p>You can download the first release of the benchmarking script here: <a href="http://code.google.com/p/dbbenchmark/">http://code.google.com/p/dbbenchmark/</a></p>
<p>Please read the README file or consult the <a href="http://www.dbbenchmark.com/wordpress/support/">Support page</a> before running the benchmarks.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25697&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25697&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/08/28/dbbenchmark-com-%e2%80%93-benchmarking-script-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dbbenchmark.com – Site launched</title>
		<link>http://www.dbbenchmark.com/wordpress/2010/08/28/site-launched/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dbbenchmark-com-%25e2%2580%2593-site-launched</link>
		<comments>http://www.dbbenchmark.com/wordpress/2010/08/28/site-launched/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 00:26:21 +0000</pubDate>
		<dc:creator>Matt Reid</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql server]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dbbenchmark.com/wordpress/?p=31</guid>
		<description><![CDATA[Welcome to DBbenchmarks.com, a publicly accessible database that tracks anonymously submitted data about MySQL server performance. You can use this site to see research the performance of certain types of hardware when running MySQL. Our open-source benchmarking script is free to own and use, we only ask that you allow the script to connect to this database and submit the results. All results and data collected is anonymous and viewable on this site. We only track performance data from MySQL &#8211; you can see the list on the About page.
Check out the database of benchmarks here: [link]]]></description>
			<content:encoded><![CDATA[<p>Welcome to DBbenchmarks.com, a publicly accessible database that tracks anonymously submitted data about MySQL server performance. You can use this site to see research the performance of certain types of hardware when running MySQL. Our open-source benchmarking script is free to own and use, we only ask that you allow the script to connect to this database and submit the results. All results and data collected is anonymous and viewable on this site. We only track performance data from MySQL &#8211; you can see the list on the <a href="http://www.dbbenchmark.com/wordpress/">About page</a>.</p>
<p>Check out the database of benchmarks here: [<a href="http://www.dbbenchmark.com/wordpress/benchmarks/">link</a>]</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25696&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25696&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/08/28/dbbenchmark-com-%e2%80%93-site-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EXPLAIN: missing db info</title>
		<link>http://code.openark.org/blog/mysql/explain-missing-db-info?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=explain-missing-db-info</link>
		<comments>http://code.openark.org/blog/mysql/explain-missing-db-info#comments</comments>
		<pubDate>Tue, 11 May 2010 04:57:02 +0000</pubDate>
		<dc:creator>Shlomi Noach</dc:creator>
				<category><![CDATA[analysis]]></category>
		<category><![CDATA[Execution plan]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[openark kit]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://code.openark.org/blog/?p=2368</guid>
		<description><![CDATA[I&#8217;m further developing a general log hook, which can stream queries from the general log.
A particular direction I&#8217;m taking is to filter queries by their type of actions. For example, the tool (oak-hook-general-log) can be instructed to only stream out those queries which involve creation of a temporary table; or those which cause for a filesort, or full index scan, etc.
This is done by evaluating of query execution plans on the fly. I suspect the MySQL query analyzer roughly does the same (as a small part of what it does).
It&#8217;s almost nothing one cannot do with sed/awk. However, I bumped into a couple of problems:

The general log (and the mysql.general_log table, in  particular) does not indicate the particular database one is using for the query. Since slow log does indicate this data, I filed a bug on this. I currently solve this by crossing connection id with the process list, where the current database is listed. It&#8217;s shaky, but mostly works.
Just realized: there&#8217;s no DB info in the EXPLAIN output! It&#8217;s weird, since I&#8217;ve been EXPLAINing queries for years now. But I&#8217;ve always had the advantage of knowing the schema used: either because I was manually executing the query on a known schema, or mk-query-digest was kind enough to let me know.

For example, look at the following imaginary query, involving both the world and sakila databases:

mysql&#62; use test;
Database changed
mysql&#62; EXPLAIN SELECT * FROM world.Country JOIN sakila.city WHERE Country.Capital = city.city_id;
+----+-------------+---------+--------+---------------+---------+---------+-----------------------+------+-------------+
&#124; id &#124; select_type &#124; table   &#124; type   &#124; possible_keys &#124; key     &#124; key_len &#124; ref                   &#124; rows &#124; Extra       &#124;
+----+-------------+---------+--------+---------------+---------+---------+-----------------------+------+-------------+
&#124;  1 &#124; SIMPLE      &#124; Country &#124; ALL    &#124; NULL          &#124; NULL    &#124; NULL    &#124; NULL                  &#124;  239 &#124;             &#124;
&#124;  1 &#124; SIMPLE      &#124; city    &#124; eq_ref &#124; PRIMARY       &#124; PRIMARY &#124; 2       &#124; world.Country.Capital &#124;    1 &#124; Using where &#124;
+----+-------------+---------+--------+---------------+---------+---------+-----------------------+------+-------------+
2 rows in set (0.00 sec)


The query is imaginary, since the tables don&#8217;t actually have anything in common. But look at the EXPLAIN result: can you tell where city came from? Country can somehow be parsed from the ref column, but no help on city.
Moreover, table aliases show on the EXPLAIN plan (which is good), but with no reference to the original table.
So, is it back to parsing of the SQL query? I&#8217;m lazy reluctant to do that. It&#8217;s error prone, and one needs to implement, or use, a good parser, which also accepts MySQL dialect. Haven&#8217;t looked into this yet.
I&#8217;m currently at a standstill with regard to automated query execution plan evaluation where database cannot be determined.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m further developing a general log hook, which can stream queries from the general log.</p>
<p>A particular direction I&#8217;m taking is to filter queries by their type of actions. For example, the tool (<a href="http://code.google.com/p/openarkkit/source/browse/trunk/openarkkit/src/oak/oak-hook-general-log.py">oak-hook-general-log</a>) can be instructed to only stream out those queries which involve creation of a temporary table; or those which cause for a filesort, or full index scan, etc.</p>
<p>This is done by evaluating of query execution plans on the fly. I suspect the <a href="http://www.mysql.com/why-mysql/white-papers/mysql_wp_queryanalyzer.php">MySQL query analyzer</a> roughly does the same (as a small part of what it does).</p>
<p>It&#8217;s almost nothing one cannot do with sed/awk. However, I bumped into a couple of problems:</p>
<ol>
<li>The general log (and the <strong>mysql.general_log table</strong>, in  particular) does not indicate the particular database one is using for the query. Since slow log does indicate this data, I <a href="http://bugs.mysql.com/bug.php?id=52554">filed a bug</a> on this. I currently solve this by crossing connection id with the process list, where the current database is listed. It&#8217;s shaky, but mostly works.</li>
<li>Just realized: there&#8217;s no DB info in the <strong>EXPLAIN</strong> output! It&#8217;s weird, since I&#8217;ve been EXPLAINing queries for years now. But I&#8217;ve always had the advantage of <em>knowing</em> the schema used: either because I was manually executing the query on a known schema, or <a href="http://www.maatkit.org/doc/mk-query-digest.html">mk-query-digest</a> was kind enough to let me know.</li>
</ol>
<p><span></span>For example, look at the following imaginary query, involving both the <strong>world</strong> and <strong>sakila</strong> databases:</p>
<blockquote>
<pre>mysql&gt; use test;
Database changed
mysql&gt; EXPLAIN SELECT * FROM world.Country JOIN sakila.city WHERE Country.Capital = city.city_id;
+----+-------------+---------+--------+---------------+---------+---------+-----------------------+------+-------------+
| id | select_type | table   | type   | possible_keys | key     | key_len | ref                   | rows | Extra       |
+----+-------------+---------+--------+---------------+---------+---------+-----------------------+------+-------------+
|  1 | SIMPLE      | Country | ALL    | NULL          | NULL    | NULL    | NULL                  |  239 |             |
|  1 | SIMPLE      | city    | eq_ref | PRIMARY       | PRIMARY | 2       | world.Country.Capital |    1 | Using where |
+----+-------------+---------+--------+---------------+---------+---------+-----------------------+------+-------------+
2 rows in set (0.00 sec)
</pre>
</blockquote>
<p>The query is imaginary, since the tables don&#8217;t actually have anything in common. But look at the <strong>EXPLAIN</strong> result: can you tell where <strong>city</strong> came from? <strong>Country</strong> can somehow be parsed from the <strong>ref</strong> column, but no help on <strong>city</strong>.</p>
<p>Moreover, table aliases show on the <strong>EXPLAIN</strong> plan (which is good), but with no reference to the original table.</p>
<p>So, is it back to parsing of the SQL query? I&#8217;m <span>lazy</span> reluctant to do that. It&#8217;s error prone, and one needs to implement, or use, a good parser, which also accepts MySQL dialect. Haven&#8217;t looked into this yet.</p>
<p>I&#8217;m currently at a standstill with regard to automated query execution plan evaluation where database cannot be determined.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=24715&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=24715&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2010/05/11/explain-missing-db-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

