TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

UUIDs are so much better than autoincrementing ids and it's not even close

4 点作者 ardme大约 2 年前

1 comment

idiocrat大约 2 年前
(For MS SQL server)<p>If UUIDs are not sequential (i.e. random), there could be performance problems to used those as PK with an underlying clustered index (CI).<p>The CIs work best with sequential values.<p>Inserting a random value into a CI will certainly cause: (1) touching of many pages (write amplification), (2) index fragmentation, (3) page splits, (4) pages being half-full.<p>Furthermore, if you have other indexes defined on the table, these problems apply to these indexes also.<p>This of cause depends on data quality and data volume.<p>For the &quot;mostly-append&quot; fact tables, I would advise against using UUIDs as PKs with CI.
评论 #34977928 未加载