title: How would `pseudo_encrypt(int)` primary keys affect performance in postgres?
body: <p>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 <a href="https://wiki.postgresql.org/wiki/Pseudo_encrypt" rel="nofollow noreferrer"><code>pseudo_encrypt(int)</code></a> 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.</p>
  
  <p>Also, if it's fine to use this, how can I lock <a href="https://wiki.postgresql.org/wiki/Pseudo_encrypt_constrained_to_an_arbitrary_range" rel="nofollow noreferrer"><code>bounded_pseudo_encrypt(int, int)</code></a> between 1000000000 - 9999999999? I understand the calculations there but I don't understand the significance of the numbers used.</p>