None
EN
When Postgres index meets Bcrypt
[]
n0rdy personal blog
The user enters their SSN in the UI, and the UI sends it to the Internal service (actually, SSN was fetched securely via the national electronic identification system, but that’s not important for the story) Internal service checks whether the data for the user with such SSN is already present in the DB (Postgres): if yes, that data is returned to the UI Otherwise, the request is made to the Third-party API to fetch the desired data, then it’s being processed, saved into the DB, and returned to the user Anyway, the intermediate goal was achieved, as at that point of time, I could reproduce the performance issue in my local setup as well, the SELECT * FROM users WHERE ssn_hash = crypt('0852285111', ssn_hash) query became as slow as within the production DB, even though my SSN wasn’t among…