Is it faster to search for a large string in a DB by its hashcode?

前端 未结 10 2502
余生分开走
余生分开走 2020-12-17 19:32

If I need to retrieve a large string from a DB, Is it faster to search for it using the string itself or would I gain by hashing the string and storing the hash in the DB as

10条回答
  •  星月不相逢
    2020-12-17 19:59

    I am confused and am probably misunderstanding your question.

    If you already have the string (thus you can compute the hash), why do you need to retrieve it?

    Do you use a large string as the key for something perhaps?

提交回复
热议问题