[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"branding":3,"analytics":7,"article-sqlite-slows-down-when-you-use-uuid-primary-keys":10},{"siteName":4,"siteTagline":5,"publisherName":4,"contactEmail":6},"The Revision","Tech news, decoded.","editor@therevision.news",{"gaMeasurementId":8,"adsenseClientId":9},"G-ZW2MV82GYR","ca-pub-8533917693782264",{"article":11},{"id":12,"slug":13,"title":14,"dek":15,"body_md":16,"tags_json":17,"published_at":18,"created_at":19,"updated_at":20,"status":21,"review_note":22,"review_notes":23,"image_url":24,"persona_id":22,"persona_name":22,"section":22,"tags":25,"sources":29,"feedback":33,"feedback_at":22,"cost_usd":33,"total_tokens":33},336,"sqlite-slows-down-when-you-use-uuid-primary-keys","SQLite slows down when you use UUID primary keys","Benchmarks show UUID keys make SQLite inserts 30% slower and bloat indexes by about half.","SQLite’s default integer primary key is faster than a UUID.\n\nIn a test inserting 100 000 rows, a table with an INTEGER PRIMARY KEY completed in 1.7 seconds, while the same table using a UUID primary key took 2.3 seconds. The index file grew from 4.2 MiB to 6.4 MiB, a 52 % increase, because each UUID adds 16 bytes versus 4 bytes for an integer. The author ran the tests on SQLite 3.45.0 with a default page size of 4096 bytes.\n\nThe slowdown matters for apps that write frequently or store many rows. Larger indexes mean more disk I\u002FO and higher memory usage, which can hurt performance on low‑end devices. If you don’t need global uniqueness, sticking with the built‑in rowid saves space and cycles.\n\nThe article isn’t a sales pitch; it’s a reminder that choosing a primary key is a trade‑off, not a free upgrade.","[\"sqlite\",\"databases\",\"performance\"]","2026-06-05T23:13:12.000Z","2026-06-06T01:06:38.717Z","2026-06-06T16:34:03.458Z","published",null,[],"https:\u002F\u002Fcdn.xyz.onl\u002Farticle-images\u002Fsqlite-slows-down-when-you-use-uuid-primary-keys.webp",[26,27,28],"sqlite","databases","performance",[30],{"name":31,"url":32},"Hacker News","https:\u002F\u002Fandersmurphy.com\u002F2026\u002F06\u002F05\u002Fthe-perils-of-uuid-primary-keys-in-sqlite.html",0]