DEV Community

loading...

Discussion on: How to build unique indexes in PostgreSQL on large text

Collapse
rhymes profile image
rhymes Author • Edited

Hi kip, you're right, MD5 tends to be faster than SHA2, but as we're not building a brute forcing app the time difference of computing the hash in C (PostgreSQL pgcrypto is written in it AFAIK) is not that big, also given the fact it's going to be done asynchronously.

Fun fact: SHA-512 is faster than SHA-256 on 64bit processors:

Benchmarks

I would like to see also some real-life measurements here, so I hope you'll like it ;)


Intel Core i7-7700HQ (7th gen = Kaby Lake); RAM (DDR4)

HW / OS configuration:

Collapse
kip13 profile image
kip • Edited

Yes, i understand, my idea here is give some thoughts about why exists the expression go away MD5, use md5 for id signature isnt too bad.

Like you said the async execution of computing is a big advantage here, whatever was the hash.

SHA-512 is faster than SHA-256 on 64bit processors

Lets digging in that !

Thread Thread
rhymes profile image
rhymes Author

Yes, i understand, my idea here is give some thoughts about why exists the expression go away MD5, use md5 for id signature isnt too bad.

Ah ah yeah, it's not too bad. My parenthesis was probably too harsh :)