For additional context, see the discussion on T355672: Investigate: How to make the GUC query performant.
Background
A couple of new features need this table:
- The new Global User Contributions (GUC) tool will allow looking up edits from temporary users using the same IP address or range, across all wikis
- GlobalBlocking will introduce global autoblocks against accounts, which will involve looking up IP addresses used by accounts across all wikis
In order for both features to avoid querying the CheckUser tables for all wikis, we can introduce a shared table that records which IPs have recently edited which wikis.
Suggested structure
Columns:
- IP (hex value)
- Central ID
- Wiki ID
- Whether the row is for GUC
- Timestamp of most recent change
Indexes:
- Primary key on (IP, is the row for guc, wiki ID, central ID). This allows us to select the wiki IDs, given an IP address or range for GUC while only including temporary accounts contributions to ensure an efficient lookup.
- Index on the central ID and timestamp, to allow finding the most recently used IP address(es) for GlobalBlocking auto blocks.
- Index on timestamp. This allows us to purge rows older than $wgCUDMaxAge.
Shared table
This could be shared using virtual domains, configured similar to this example.