{"id":4526,"date":"2012-02-08T11:53:30","date_gmt":"2012-02-08T09:53:30","guid":{"rendered":"http:\/\/code.openark.org\/blog\/?p=4526"},"modified":"2012-02-08T11:53:30","modified_gmt":"2012-02-08T09:53:30","slug":"common_schema-rev-218-queryscript-throttling-processes-documentation","status":"publish","type":"post","link":"https:\/\/code.openark.org\/blog\/mysql\/common_schema-rev-218-queryscript-throttling-processes-documentation","title":{"rendered":"common_schema rev. 218: QueryScript, throttling, processes, documentation"},"content":{"rendered":"<p><a href=\"http:\/\/code.google.com\/p\/common-schema\/\">common_schema<\/a>, revision <strong>218<\/strong> is released, with major new features, top one being <em>server side scripting<\/em>. Here are the highlights:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.queryscript.com\/\"><strong>QueryScript<\/strong><\/a>: server side scripting is now supported by <em>common_schema<\/em>, which acts as an interpreter for QueryScript code.<\/li>\n<li>Throttling for queries is now made available via the <strong>throttle()<\/strong> function.<\/li>\n<li>Enhancements to processlist-related views, including the new <strong>slave_hosts<\/strong> view.<\/li>\n<li>Inline documentation\/help is available via the <strong>help()<\/strong> routine.<\/li>\n<li>more&#8230;<\/li>\n<\/ul>\n<h4>QueryScript<\/h4>\n<p><em>common_schema<\/em> makes for a QueryScript implementation for MySQL. You can run server side scripts, interpreted by <em>common_schema<\/em>, which allow for easy syntax and greater power than was otherwise previously available on the MySQL server. For example:<\/p>\n<blockquote>\n<pre>foreach($table, $schema, $engine: table like '%')\r\n  if ($engine = 'ndbcluster')\r\n    ALTER ONLINE TABLE :$schema.:$table REORGANIZE PARTITION;<\/pre>\n<\/blockquote>\n<p>QueryScript includes flow control, conditional branching, variables &amp; variable expansion, script throttling and more.<\/p>\n<p>Read more on <a href=\"http:\/\/common-schema.googlecode.com\/svn\/trunk\/common_schema\/doc\/html\/query_script.html\">common_schema&#8217;s QueryScript implementation<\/a>.<\/p>\n<h4><!--more-->Query throttling<\/h4>\n<p><a href=\"http:\/\/code.openark.org\/blog\/mysql\/self-throttling-mysql-queries\">Throttling for MySQL queries<\/a> was suggested by means of elaborate query manipulation. It is now reduced into a single throttle function: one can now just invoke <strong>throttle(3)<\/strong> on one&#8217;s query, so as to make the query execute for a <em>longer<\/em> time, while taking short sleep breaks during operation, easing up the query&#8217;s demand for resources.<\/p>\n<p>Read more on <a href=\"http:\/\/common-schema.googlecode.com\/svn\/trunk\/common_schema\/doc\/html\/throttle.html\">query throttling<\/a>.<\/p>\n<h4>Process views<\/h4>\n<p>The <strong>processlist_grantees<\/strong> view provides with more details on the running processes. <strong>slave_hosts<\/strong> is a new view, listing hostnames of connected slaves.<\/p>\n<p>Read more on <a href=\"http:\/\/common-schema.googlecode.com\/svn\/trunk\/common_schema\/doc\/html\/process_views.html\">process views<\/a>.<\/p>\n<h4>help()<\/h4>\n<p>The <em>common_schema<\/em> documentation is now composed of well over <strong>100<\/strong> pages, including synopsis, detailed internals discussion, notes and examples. I can&#8217;t exaggerate in saying that the documentation took the vast majority of time for this code to release.<\/p>\n<p>The documentation is now made available inline, from within you mysql client, via the <a href=\"http:\/\/common-schema.googlecode.com\/svn\/trunk\/common_schema\/doc\/html\/help.html\"><strong>help()<\/strong><\/a> routine. Want to know more about redundant (duplicate) keys and how to find them? Just type:<\/p>\n<blockquote>\n<pre>call help('redundant');<\/pre>\n<\/blockquote>\n<p>and see what comes out!<\/p>\n<p>The entire <a href=\"http:\/\/common-schema.googlecode.com\/svn\/trunk\/common_schema\/doc\/html\/introduction.html\">documentation<\/a>, which is available online as well as a downloadable bundle, is embedded into <em>common_schema<\/em> itself. It&#8217;s rather cool.<\/p>\n<h4>Tests<\/h4>\n<p><em>common_schema<\/em> is tested. The number of tests in <em>common_schema<\/em> is rapidly growing, and new tests are introduced for new features as well as for older ones. There is not yet full coverage for all views, but I&#8217;m working hard at it. <em>common_schema<\/em> is a robust piece of code!<\/p>\n<h4>Get it!<\/h4>\n<p>Download <em>common_schema<\/em> on the <a href=\"http:\/\/code.google.com\/p\/common-schema\">common_schema project page<\/a>.<\/p>\n<p>Read the documentation <a href=\"http:\/\/common-schema.googlecode.com\/svn\/trunk\/common_schema\/doc\/html\/introduction.html\">online<\/a>, or download it as well (or call for <strong>help()<\/strong>)<\/p>\n<p><em>common_schema<\/em> is released under the BSD license.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>common_schema, revision 218 is released, with major new features, top one being server side scripting. Here are the highlights: QueryScript: server side scripting is now supported by common_schema, which acts as an interpreter for QueryScript code. Throttling for queries is now made available via the throttle() function. Enhancements to processlist-related views, including the new slave_hosts [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[5],"tags":[79,67,120,57,76,50],"class_list":["post-4526","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-administration","tag-common_schema","tag-development","tag-open-source","tag-queryscript","tag-scripts"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bZZp-1b0","_links":{"self":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/4526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/comments?post=4526"}],"version-history":[{"count":31,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/4526\/revisions"}],"predecessor-version":[{"id":4707,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/4526\/revisions\/4707"}],"wp:attachment":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/media?parent=4526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/categories?post=4526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/tags?post=4526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}