MySQL command-line tip: compare result setsWed, Mar 25, 2009 in Databases Open Source
Here’s a quick productivity tip: when optimizing queries by rewriting them to different forms that should return the same results, you can verify that you get the same results by taking a checksum of them.
Just set your pager to
mysql> pager md5sum - PAGER set to 'md5sum -' mysql> select * from test; a09bc56ac9aa0cbcc659c3d566c2c7e4 - 4096 rows in set (0.00 sec)
I'm Baron Schwartz, the founder and CEO of VividCortex. I am the author of High Performance MySQL and many open-source tools for performance analysis, monitoring, and system administration. I contribute to various database communities such as Oracle, PostgreSQL, Redis and MongoDB.