mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Feature request: avoid duplicating index for foreign key column if already covered as primary column by other indexes #6678
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @andig on GitHub (Apr 4, 2021).
I have the following simple
datatable:which gives
Since
data_uniquealready coverschannel_idin the first position, the additionalIDX_ADF3F36372F5A1AAkey onchannel_idshould not be necessary and the on-disk space for that index could be saved.@andig commented on GitHub (Apr 7, 2021):
@beberlei does the feature request make sense for you? The example above might be a bit too complicated. The same reasoning would apply when composite primary keys are used and already cover the foreign key column.
@beberlei commented on GitHub (Apr 10, 2021):
I am afraid we will introduce ourselves to a lot of edge cases should we make this a feature, while this index approach here may be inefficient space-wise, but access wise its good. If you want a more optimized schema, then I would suggest to address this with doctrine migrations or a schema visitor of your own.