标签归档:pager md5sum

快速比较查询结果是否一致

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 md5sum:

mysql> pager md5sum -
PAGER set to 'md5sum -'
mysql> select * from user;
b20bd3864962507e2e05cd8706440ffd  -
3 rows in set (0.00 sec)
mysql> select * from user;
b20bd3864962507e2e05cd8706440ffd  -
3 rows in set (0.00 sec)
mysql> select * from user;
b20bd3864962507e2e05cd8706440ffd  -
3 rows in set (0.00 sec)