Page MenuHomePhabricator

Create dynamic defaults table for user properties
Closed, DeclinedPublic



The user_properties table has grown reaching three digits millions of rows (T54777). Part of the growth is due to the lack of a mechanism to set different default values depending on the user type or time of registration. The proposal in T321527 aims to solve this problem by providing a way to dynamically set default values.


Design the database table, and merge a patch that creates it.

Additional information

Answers questions from

  • Should this table be replicated to wiki replicas (does it contain private data)?: Yes, it does not contain private data.
  • Size of the table (number of rows expected): Counting on enwiki there are ~1000 different user properties; so the table could quickly achieve that number of rows x 3, in the worst scenario where each property default is different for each type of user.
  • Expected growth per year: The table should grow moderately adding 1-3 rows for each new default value defined.
  • Expected amount of queries: writes will happen on account creation and from maintenance servers when running on-demand script to modify properties of existing users. Reads: TBD (not sure yet, we will probably add some cache layer).
  • The release plan for the feature: TBD not sure. We might want to test the overall feature in beta and a subset of wikis before a broader release.

Event Timeline

Change 958998 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/core@master] [WIP] Add table user_property_default

Sgs changed the task status from Open to In Progress.Sep 19 2023, 7:13 PM

IMO this (and the parent task) could use more dicussion, given that this is going to be a pretty widely applicable utility.

The user_properties bloat ticket was made more than ten years ago. The proposal for dynamic default was made 1.5 years ago (T54777#7724456) and was extensively discussed in a ticket with 36 subscribers and has died down for more than a year now. The user_properties table is exploding. At some point we should move on implementing a solution and this won't be set in stone so it can change later.

Sgs changed the task status from In Progress to Stalled.Sep 21 2023, 11:13 AM

I hear you both and made a request for feedback in #engineers-all Slack channel with 1 week deadline. Marking this task stalled until the discussion in the parent task finishes.

As per discussion comments in T321527 the agreed solution won't necessarily involve a DB table so I think we can decline this task.

Change 958998 abandoned by Sergio Gimeno:

[mediawiki/core@master] Add table user_property_default


Not relevant, solved using conditional defaults, see T321527