Vonng / pigsty

Battery-Included PostgreSQL Distro as a Free RDS Alternative
https://pigsty.io
GNU Affero General Public License v3.0
2.97k stars 241 forks source link

NEW PG extension: md5hash #393

Closed sunxk closed 2 months ago

sunxk commented 2 months ago

Hi,

md5hash uses a 16-byte space to store the MD5 hash value. Compared to storing MD5 hash value as a string, this method offers better performance and requires less indexing and storage space. Could you consider adding this extension in future versions?

md5hash 1.0.1

Date: 2019-11-03 Status: Stable Abstract Efficient inline storage of 128-bit binary data (e.g. MD5 hashes). Description The usual way to store MD5 hashes is in varlena columns (e.g. TEXT), which occupies unnecessary amount of data (over 32B for 16B of data). This extension defines a native 16-byte data type, stored inline, allowing more efficient storage etc. which is especially useful for hashes used as identifiers.

code: https://github.com/tvondra/md5hash homepage: https://pgxn.org/dist/md5hash

Vonng commented 2 months ago

Looks like a good extension to be included

sunxk commented 2 months ago

Hi, @Vonng

[hashtypes] extension is another option; it contains three hash types and maybe it is more suitable to be included.

hashtypes 0.1.5 data types for sha{1,256,512}, md5 and crc32

homepage: https://pgxn.org/dist/hashtypes/ code: https://github.com/adjust/hashtypes

Vonng commented 2 months ago

Hi, @Vonng

[hashtypes] extension is another option; it contains three hash types and maybe it is more suitable to be included.

hashtypes 0.1.5 data types for sha{1,256,512}, md5 and crc32

homepage: https://pgxn.org/dist/hashtypes/ code: https://github.com/adjust/hashtypes

Codebase too old, compile error. Looks the md5hash works.

Vonng commented 2 months ago

resolved, will be added in the next release: https://github.com/Vonng/pigsty-rpm/commit/59ff5f717cab1b62ba8714989ff3deeeee718c07