Page MenuHomePhabricator

Convert searchindex UNIQUE to PK
Open, MediumPublic

Description

Following up from T172514: Add new PKs to tables.sql (mysql and sqlite)

It seems searchindex was never changed from a UNIQUE to a PRIMARY KEY

--
-- When using the default MySQL search backend, page titles
-- and text are munged to strip markup, do Unicode case folding,
-- and prepare the result for MySQL's fulltext index.
--
-- This table must be MyISAM; InnoDB does not support the needed
-- fulltext index.
--
CREATE TABLE /*_*/searchindex (
  -- Key to page_id
  si_page int unsigned NOT NULL,

  -- Munged version of title
  si_title varchar(255) NOT NULL default '',

  -- Munged version of body text
  si_text mediumtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page);
CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title);
CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text);

Should be a pretty easy fix

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Reedy renamed this task from Convert search index unique to PK to Convert searchindex UNIQUE to PK.Apr 11 2020, 2:19 AM

Change 588068 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Convert searchindex UNIQUE into PRIMARY KEY

https://gerrit.wikimedia.org/r/588068

eprodromou subscribed.

Does this need an associated maintenance script?