Speed ​​up my indexes in MySQL - CRC or MD5?

I have a huge table with something like 8,300,000 rows (there will be no editing or deleting).

My first column looks about the same P300-4312B_X16_Sand the record is not unique, so I use a regular index in this field.

However, MySQL works faster using a binary field instead of varchar, so I am encoding my INDEX in MD5 using BINARY(16)data storage.

This morning I started using CRC32 for the first time, and I saw that CRC32 can be displayed as a hexadecimal string using 8 characters.

My question is: if I use CRC32 instead of MD5, it will be faster. However, when CRC32 is launched, say that 2,000,000 unique values, the result will be unique, or maybe someday I will have two identical lines for two different lines? I ask because the result is only 8 characters (32b), not 32 (128b) like MD5.

Thank.

+5
source share
1 answer

- . , 2 000 000 (2000000 * 1999999)/2 , 2x10 12. 32- CRC , 2 32 466. , .

128- MD5 6x10 -27. .

, - , CRC-32.

MD5, . , - , . 64- , , 10 $sup <-7 2 000 000 . 128- , MD5, . CityHash .

, , . .

+7

All Articles