Bug 6984 - TABLE CHECKSUM
Summary: TABLE CHECKSUM
Status: NEW
Alias: None
Product: SQL
Classification: Unclassified
Component: all (show other bugs)
Version: -- development
Hardware: Other Linux
: Normal enhancement
Assignee: SQL devs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-07 15:45 CEST by Roberto Cornacchia
Modified: 2020-10-07 16:06 CEST (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Cornacchia 2020-10-07 15:45:32 CEST
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
Build Identifier: 

At table-checksum may be helpful to test whether two tables are equal, just as it is done with files.

For reference:
- Microsoft SQL Server:
SELECT CHECKSUM_AGG(BINARY_CHECKSUM(*)) FROM TableA

- MariaDB:
CHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]


I'm mentioning checksum here, but actually any method to quickly compare two tables would be just fine. 

I guess MonetDB could would exploit its column storage, and quickly compare the checksum of each corresponding pair of columns of two tables with the same schema and count.

Reproducible: Always
Comment 1 Roberto Cornacchia 2020-10-07 16:06:33 CEST
Of course one could do

sql>\| md5sum -
sql>\D sys.tables
3e5318a46150f90e7bf8469fbef00a9f  -

But it would only be ok for interactive use and probably not very efficient.