4 ms·
> random sort order can really hurt performance I've long thought it was a problem that PostgreSQL doesn't have a real clustering key like MySQL or SQL Server.
by paulddraper 5y ago
> random sort order can really hurt performance
I've long thought it was a problem that PostgreSQL doesn't have a real clustering key like MySQL or SQL Server.
But PostgreSQL users have told me it doesn't really matter.
- dtech 5y agoIt's much less important in postgres as in some other databases, but it still hurts. Mainly because indices have to be updated and searched all over the place with UUIDs. The locality of the data on disk itself is fine because its inserted sequential.
- anarazel 5y ago> But PostgreSQL users have told me it doesn't really matter. Those users were very wrong, unless they explicitly only talked about the case where the uuids are not indexed.
- mjevans 5y agoThey'd likely argue to use natural keys instead. Use the data that matters to you, index it across more than one column.
- anarazel 5y agoFor cases where one sensibly used uuids, I don't see natural keys being an alternative. What's e.g. the natural key of an order reference that should be accessible without auth, when the key shouldn't allow enumeration and that should be allocatable without a single point of coordination?