As you may know one of the best practices in relational database design is the use of numeric primary keys which causes to boost the performance in data manipulation and retrieval.
Unfortunately there are few ways to achieve this goal and of course one of them would be use of the embedded database “AUTO NUMBER” feature which is basically very profitable for smaller applications, but it’s absolutely not reliable because of allowance of duplicate records. For instance, inserting the same person twice into the DB will cause having 2 different records.
In this situation, what comes to mind at first is to make up a PK according to the every record specifications. For example, to insert a university student data into a table, the numeric PK would consist of year of admission, score, … which makes the student No.
But, unfortunately you can not always make up such a combination for every record.
So, the other option, as I think, is the use of HASH ALGORITHMS which produce unique numeric outputs based on an input String. For instance you give the algorithm a combination of some specific characteristics as a String input and then you receive a unique number as output.
Now, what I wanted to know is that can anybody propose a better solution?
Does anyone have such a Hash Algorithm?