Page MenuHomePhabricator

Convert searchindex UNIQUE to PK
Closed, ResolvedPublic

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?

Change #935486 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/core@master] Searchindex primary key, InnoDB engine and title length

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

TheDJ changed the task status from Open to Stalled.Jul 15 2024, 7:18 PM

Change #935486 merged by jenkins-bot:

[mediawiki/core@master] Searchindex primary key, title length and utf8mb4

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

TheDJ claimed this task.

Change #588068 abandoned by TheDJ:

[mediawiki/core@master] Convert searchindex UNIQUE into PRIMARY KEY

Reason:

Abandoned in favor of Change I12adff3e6ca6a9986ff207bef16272195c3a6a48

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

Change #1085917 had a related patch set uploaded (by Reedy; author: TheDJ):

[mediawiki/core@REL1_43] Searchindex primary key, title length and utf8mb4

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

Change #1085918 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] RELEASE-NOTES-1.43: Move change from RELEASE-NOTES-1.44

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

Change #1085917 merged by jenkins-bot:

[mediawiki/core@REL1_43] Searchindex primary key, title length and utf8mb4

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

Change #1085918 merged by jenkins-bot:

[mediawiki/core@master] RELEASE-NOTES-1.43: Move change from RELEASE-NOTES-1.44

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