samedi 23 mai 2020

How would `pseudo_encrypt(int)` primary keys affect performance in postgres?

I was planning to use UUIDv4 for the primary key but it's way too long to share as part of URL. I was thinking of using pseudo_encrypt(int) as primary key. How would that affect lookup performance for a table with couple billion rows? It's a schema divided multi-tenant system by the way.

Also, if it's fine to use this, how can I lock bounded_pseudo_encrypt(int, int) between 1000000000 - 9999999999? I understand the calculations there but I don't understand the significance of the numbers used.




Aucun commentaire:

Enregistrer un commentaire