Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am for the moment; if postgres is really that much better in this regard, please let me know why you think so.

Incidentally, I'm using VARBINARY, not VARCHAR for the keys.



Mysql/innodb lays out the data on disk in sort order of the primary key. If you use GUIDs as primary key it will have to re-write the entire disk layout every time you insert. Just use auto inc IDs, they are by far the best option as long as you use a suffix of 10 or so to avoid ID collisions when you ever have several masters to write to ( which you will never have ).


There are other reasons I want to use strings-as-keys. Are you familiar with how, say, postgres handles this sort of thing, and is it any better in this regard?


It occurs to me that I could still use integer primary keys internally and have indexed strings as external lookup keys. I want the same key to be able to show (a) which user, (b) which database, and (c) which row, so I can verify ownership and route directly to the particular sub-db without having to do several lookups first.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: