field_config_entity_type.type is a varchar(255). Do we really need so many characters to name our entities. In what situation would a sane developer use 255 characters to name an entity? In MySQL 5.0 InnoDB, keys are limited to 1024 bytes, which translates to 341 chars. That means that if you want to create a key containing an entity type, you're limited to 84 extra chars for the other columns. We just run into this problem in #493030: RDF #1: core RDF module where we created a key for (type, bundle), respectively varchar(255), varchar(128) which turned out to be a time consuming disaster to debug against the testing bot. The block module for example creates a key on 3 varchar columns, but their size is much smaller (64 max each).
In general, our machine readable names are smaller:
node_type.type: varchar(32)
field_config.field_name: varchar(32)
field_config.type: varchar(128)
field_config_instance.bundle: varchar(128)
Comment | File | Size | Author |
---|---|---|---|
#1 | 600490_entity_type_size_1.patch | 568 bytes | scor |
Comments
Comment #1
scor CreditAttribution: scor commentedthis patch changes field_config_entity_type.type to varchar(128) instead of varchar(255).
Comment #2
scor CreditAttribution: scor commentedbetter title
Comment #3
yched CreditAttribution: yched commentedMakes sense.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!