2 years ago

#57269

test-img

Unknown User

Best Way to store hash In MYSQL DB and Indexing it (PHP)

I recently learned to use UUID, and I use UUIDShortener(https://packagist.org/packages/keiko/uuid-shortener) to get a string I can use to share publicly in URL (ex: mavTAjNm4NVztDwh4gdSrQ)

I want this to be indexed pretty well in mySQL DB so SQL can retrive this data very fast among millions of rows.

What is the best way to store this string in InnoDB indexing motor (pretty sure Varchar would be the worst to use)

I envisage to use pack and unpack function in PHP to get a binary or an Integer that mySql would indexed fast, but never used thoses functions...

What would be the best options for packing data using pack here? And what would be the Type of the column in Mysql?

If anyone could help,

Thanks

php

sql

hash

pack

unpack

0 Answers

Your Answer

Accepted video resources