Page MenuHomePhabricator

Normalize user_properties table
Open, MediumPublic

Description

The user_properties table (wiki docs) includes the name of the property as a VARBINARY field (up_property), so the same strings get repeated over and over. Property names should be normalized into a separate table:

CREATE TABLE user_property_names (
    upn_id INT UNSIGNED AUTO_INCREMENT NOT NULL,
    upn_property_name VARBINARY(255) NOT NULL,
    PRIMARY KEY (upd_id),
    UNIQUE KEY (upn_property_name)
);

See also: