postgresql – Storing URL paths as unique identifiers in Postgres

I need to find a performant way for storing and looking up friendly paths for a multi-tenant SaaS, e.g. I also need to retrieve the paths from the database to generate human-readable links to entities for notifications and sharing.

Is storing the paths in plaintext as unique varchar(maxlength) the only way to broach this or is there room for optimization?

Also, unless I introduce an intermediary step of requesting the client’s PK first, all API requests would use the path as the ID (and I could cache the real PK in Redis for back-end usage).