Can a hashing algorithm be used to save space in the database?
I came up with a good "hash reuse" technique (it's probably widely used)
I figured out the hashcode of all fields in the string, and then I used that hashcode as the primary key.
When I pasted, I just did "INSERT IGNORE" (to suppress duplicate primary key errors). In any case, I could be sure that what I wanted to insert was present in the database after the insert.
If this is a known concept, I'd love to hear about it!
a source to share
There is no need for this. Databases already have a good way to avoid data duplication - database normalization.
For example, imagine you have a column that can contain one of five different rows. Instead of storing one of these rows on each row, you should move that row to a separate table. Create a table with two columns, one with row values ββand the other as the primary key. Now you can use a foreign key on your original table instead of storing the entire row.
a source to share