hash - Search by hashing mysql columns -
i have query compares values of many columns , returns result. have add column compare, text field , not indexed. thinking instead of doing this, lets add column called hash, hash of these columns , can compare against hash produced code these same columns.
1) want know result in performance enhancement , how beneficial this?
2) mysql provide function hash combination of columns , store results can hash existing columns without having write separate code this.
3) hash go for, md5 or sha?
4) idea @ all?
i have few million records , few more millions expected generated within months, hashing these produce unique results each record?
thanks, harsha
1) result in performance enhancement although suspect reinventing manually has been implemented in indexing engines of db... recommend use built-in index mechanisms...
2) yes - has md5
, sha
/ sha1
sql functions hash strings, need convert/cast whatever values want hash string...
3) depends on data - guess sha
choice...
4) don't think so... reinvention of db has built-in , wouldn't mean rid of indexes... if want perform have index column hash value...
5) not sure unique unlikely produce collisions...
i rethink approach , use composite index. if composite index doesn't suite needs create column contains concatenated values , index that...
Comments
Post a Comment