{"id":730,"date":"2009-04-16T10:02:17","date_gmt":"2009-04-16T08:02:17","guid":{"rendered":"http:\/\/code.openark.org\/blog\/?p=730"},"modified":"2009-04-16T10:02:17","modified_gmt":"2009-04-16T08:02:17","slug":"a-note-on-barons-command-line-tip-for-comparing-result-sets","status":"publish","type":"post","link":"https:\/\/code.openark.org\/blog\/mysql\/a-note-on-barons-command-line-tip-for-comparing-result-sets","title":{"rendered":"A note on Baron&#8217;s command line tip for comparing result sets"},"content":{"rendered":"<p>A while ago <a href=\"http:\/\/www.xaprb.com\/\">Baron Schwartz<\/a> published a <a href=\"http:\/\/www.xaprb.com\/blog\/2009\/03\/25\/mysql-command-line-tip-compare-result-sets\/\">MySQL command-line tip: compare result sets<\/a>.<\/p>\n<p>A &#8220;<strong>SELECT * FROM world<\/strong>&#8220;, for example, can be checksummed, compared with another checksum made on a replica, or otherwise another table which is supposed to contains the exact same data.<\/p>\n<p>I just wanted to note that if you&#8217;re dealing with a MyISAM table, a simple &#8220;<strong>SELECT * FROM<\/strong>&#8221; will not necessarily be too useful, since MyISAM can store rows in any particular order: two different settings of <strong>concurrent_insert<\/strong>, or perhaps an <strong>OPTIMIZE<\/strong>d table, can make for different ordering, hence different checksums.<\/p>\n<p>Use of &#8220;<strong>ORDER BY &#8230;<\/strong>&#8221; is required if you want to have a consistent checksum. With MyISAM, you don&#8217;t usually want to count on natural row ordering, at any case.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while ago Baron Schwartz published a MySQL command-line tip: compare result sets. A &#8220;SELECT * FROM world&#8220;, for example, can be checksummed, compared with another checksum made on a replica, or otherwise another table which is supposed to contains the exact same data. I just wanted to note that if you&#8217;re dealing with a [&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":[],"class_list":["post-730","post","type-post","status-publish","format-standard","hentry","category-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bZZp-bM","_links":{"self":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/730","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=730"}],"version-history":[{"count":7,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/730\/revisions"}],"predecessor-version":[{"id":737,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/730\/revisions\/737"}],"wp:attachment":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/media?parent=730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/categories?post=730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/tags?post=730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}