File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -344,6 +344,14 @@ entity primary keys::
344
344
// ...
345
345
}
346
346
347
+ .. caution ::
348
+
349
+ Using UUIDs as primary keys is usually not recommended for performance reasons:
350
+ indexes take more space (because UUIDs in binary format take 128 bits instead
351
+ of 32/64 bits for auto-incremental integers) and the non-sequential nature of
352
+ UUIDs fragments indexes. UUID v7 is the only variant that solves the fragmentation
353
+ issue (but the index size issue remains).
354
+
347
355
When using built-in Doctrine repository methods (e.g. ``findOneBy() ``), Doctrine
348
356
knows how to convert these UUID types to build the SQL query
349
357
(e.g. ``->findOneBy(['user' => $user->getUuid()]) ``). However, when using DQL
You can’t perform that action at this time.
0 commit comments