Answer the question
In order to leave comments, you need to log in
How is the database searched based on get url parameters?
Some services: Youtube, Yandex.Disk, other cloud storages, etc. add a parameter to the url that identifies a specific video or file, and consists of a set of letters and numbers. Something like 9bZkp7q19f0. Interested in how a database search is performed that matches these parameters with a file identifier (int32 or int64). It is logical that it makes no sense to sort through the entire database. I assumed that there is some kind of hash function that one-to-one translates this parameter into a number and vice versa, but I did not google anything. Are there such hash functions? And if not, how is the comparison made?
Answer the question
In order to leave comments, you need to log in
Something like 9bZkp7q19f0This is the surrogate key. It can be calculated in any way (immediately unique or with verification). Counter (integer) is the simplest ID+1 function.
how a database lookup is performed that maps these options to a file id (int32 or int64)This is the user post/post ID itself. No transformations with this parameter before extracting data from the database using it are done.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question