jetify-com / typeid-sql

SQL implementation TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs
Apache License 2.0
83 stars 6 forks source link

Any note on performance implications? type-id vs. text #6

Open talksik opened 1 year ago

talksik commented 1 year ago

Thank you for this!

I was just curious whether I should just go with having the primary key as text or use the scripts to have a type_id in SQL? The text approach seems simpler, but wondering how it impacts Postgresql performance.

Also, the docs in the #Usage section put the type of the "id" field as user_id. Is it supposed to be type_id? Is that a typo?

loreto commented 2 months ago

I know this response is coming a year later, but I didn't really have a good perspective on this question before.

Now that we've been using typeid in production in our own postgres here are my thoughts: