Drop ss_total_views and page_counter fields from MediaWiki
Follows up removal of code using hitcounters in 90d90dad6
RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Removing_hit_counters_from_MediaWiki_core
Change-Id: Ieeb558f9523c11965cbc1941cad4f316c00c85c5
This commit is contained in:
parent
213c71b55e
commit
5f8edb2c0a
18 changed files with 74 additions and 58 deletions
|
|
@ -674,7 +674,6 @@ abstract class Installer {
|
|||
'site_stats',
|
||||
array(
|
||||
'ss_row_id' => 1,
|
||||
'ss_total_views' => 0,
|
||||
'ss_total_edits' => 0,
|
||||
'ss_good_articles' => 0,
|
||||
'ss_total_pages' => 0,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ class MssqlUpdater extends DatabaseUpdater {
|
|||
|
||||
// 1.24
|
||||
array( 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql'),
|
||||
array( 'dropTable', 'hitcounter' ),
|
||||
array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ),
|
||||
array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ),
|
||||
// Constraint updates
|
||||
array( 'updateConstraints', 'category_types', 'categorylinks', 'cl_type' ),
|
||||
array( 'updateConstraints', 'major_mime', 'filearchive', 'fa_major_mime' ),
|
||||
|
|
|
|||
|
|
@ -266,6 +266,9 @@ class MysqlUpdater extends DatabaseUpdater {
|
|||
'patch-oi_major_mime-chemical.sql' ),
|
||||
array( 'modifyField', 'filearchive', 'fa_major_mime',
|
||||
'patch-fa_major_mime-chemical.sql' ),
|
||||
array( 'dropTable', 'hitcounter' ),
|
||||
array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ),
|
||||
array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -516,7 +519,6 @@ class MysqlUpdater extends DatabaseUpdater {
|
|||
page_namespace int NOT NULL,
|
||||
page_title varchar(255) binary NOT NULL,
|
||||
page_restrictions tinyblob NOT NULL,
|
||||
page_counter bigint(20) unsigned NOT NULL default '0',
|
||||
page_is_redirect tinyint(1) unsigned NOT NULL default '0',
|
||||
page_is_new tinyint(1) unsigned NOT NULL default '0',
|
||||
page_random real unsigned NOT NULL,
|
||||
|
|
@ -598,9 +600,9 @@ class MysqlUpdater extends DatabaseUpdater {
|
|||
$this->output( "......Setting up page table.\n" );
|
||||
$this->db->query(
|
||||
"INSERT INTO $page (page_id, page_namespace, page_title,
|
||||
page_restrictions, page_counter, page_is_redirect, page_is_new, page_random,
|
||||
page_restrictions, page_is_redirect, page_is_new, page_random,
|
||||
page_touched, page_latest, page_len)
|
||||
SELECT cur_id, cur_namespace, cur_title, cur_restrictions, cur_counter,
|
||||
SELECT cur_id, cur_namespace, cur_title, cur_restrictions,
|
||||
cur_is_redirect, cur_is_new, cur_random, cur_touched, rev_id, LENGTH(cur_text)
|
||||
FROM $cur,$revision
|
||||
WHERE cur_id=rev_page AND rev_timestamp=cur_timestamp AND rev_id > {$maxold}",
|
||||
|
|
|
|||
|
|
@ -102,6 +102,9 @@ class OracleUpdater extends DatabaseUpdater {
|
|||
|
||||
// 1.24
|
||||
array( 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql' ),
|
||||
array( 'dropTable', 'hitcounter' ),
|
||||
array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ),
|
||||
array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ),
|
||||
|
||||
// KEEP THIS AT THE BOTTOM!!
|
||||
array( 'doRebuildDuplicateFunction' ),
|
||||
|
|
@ -172,7 +175,6 @@ class OracleUpdater extends DatabaseUpdater {
|
|||
'page_id' => 0,
|
||||
'page_namespace' => 0,
|
||||
'page_title' => ' ',
|
||||
'page_counter' => 0,
|
||||
'page_is_redirect' => 0,
|
||||
'page_is_new' => 0,
|
||||
'page_random' => 0,
|
||||
|
|
|
|||
|
|
@ -418,6 +418,9 @@ class PostgresUpdater extends DatabaseUpdater {
|
|||
array( 'addPgField', 'pagelinks', 'pl_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ),
|
||||
array( 'addPgField', 'templatelinks', 'tl_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ),
|
||||
array( 'addPgField', 'imagelinks', 'il_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ),
|
||||
array( 'dropTable', 'hitcounter' ),
|
||||
array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ),
|
||||
array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,6 +137,9 @@ class SqliteUpdater extends DatabaseUpdater {
|
|||
array( 'addField', 'pagelinks', 'pl_from_namespace', 'patch-pl_from_namespace.sql' ),
|
||||
array( 'addField', 'templatelinks', 'tl_from_namespace', 'patch-tl_from_namespace.sql' ),
|
||||
array( 'addField', 'imagelinks', 'il_from_namespace', 'patch-il_from_namespace.sql' ),
|
||||
array( 'dropTable', 'hitcounter' ),
|
||||
array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ),
|
||||
array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
2
maintenance/archives/patch-drop-page_counter.sql
Normal file
2
maintenance/archives/patch-drop-page_counter.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-- field is deprecated and no longer updated as of 1.25
|
||||
ALTER TABLE /*_*/page DROP COLUMN page_counter;
|
||||
2
maintenance/archives/patch-drop-ss_total_views.sql
Normal file
2
maintenance/archives/patch-drop-ss_total_views.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-- field is deprecated and no longer updated as of 1.24
|
||||
ALTER TABLE /*_*/site_stats DROP COLUMN ss_total_views;
|
||||
|
|
@ -1811,7 +1811,6 @@ historysubmit
|
|||
historywarning
|
||||
hit
|
||||
hitcount
|
||||
hitcounter
|
||||
hits
|
||||
hlist
|
||||
hmac
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ CREATE TABLE /*_*/page (
|
|||
page_namespace INT NOT NULL,
|
||||
page_title NVARCHAR(255) NOT NULL,
|
||||
page_restrictions NVARCHAR(255) NOT NULL,
|
||||
page_counter BIGINT NOT NULL DEFAULT 0,
|
||||
page_is_redirect BIT NOT NULL DEFAULT 0,
|
||||
page_is_new BIT NOT NULL DEFAULT 0,
|
||||
page_random real NOT NULL DEFAULT RAND(),
|
||||
|
|
@ -422,9 +421,6 @@ CREATE TABLE /*_*/site_stats (
|
|||
-- The single row should contain 1 here.
|
||||
ss_row_id int NOT NULL,
|
||||
|
||||
-- Total number of page views, if hit counters are enabled.
|
||||
ss_total_views bigint default 0,
|
||||
|
||||
-- Total number of edits performed.
|
||||
ss_total_edits bigint default 0,
|
||||
|
||||
|
|
@ -452,18 +448,6 @@ CREATE TABLE /*_*/site_stats (
|
|||
CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
|
||||
|
||||
|
||||
--
|
||||
-- Stores an ID for every time any article is visited;
|
||||
-- depending on $wgHitcounterUpdateFreq, it is
|
||||
-- periodically cleared and the page_counter column
|
||||
-- in the page table updated for all the articles
|
||||
-- that have been visited.)
|
||||
--
|
||||
CREATE TABLE /*_*/hitcounter (
|
||||
hc_id int NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- The internet is full of jerks, alas. Sometimes it's handy
|
||||
-- to block a vandal or troll account.
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ CREATE TABLE &mw_prefix.page (
|
|||
page_namespace NUMBER DEFAULT 0 NOT NULL,
|
||||
page_title VARCHAR2(255) NOT NULL,
|
||||
page_restrictions VARCHAR2(255),
|
||||
page_counter NUMBER DEFAULT 0 NOT NULL,
|
||||
page_is_redirect CHAR(1) DEFAULT '0' NOT NULL,
|
||||
page_is_new CHAR(1) DEFAULT '0' NOT NULL,
|
||||
page_random NUMBER(15,14) NOT NULL,
|
||||
|
|
@ -247,7 +246,6 @@ CREATE UNIQUE INDEX &mw_prefix.iwlinks_ui02 ON &mw_prefix.iwlinks (iwl_prefix, i
|
|||
|
||||
CREATE TABLE &mw_prefix.site_stats (
|
||||
ss_row_id NUMBER NOT NULL ,
|
||||
ss_total_views NUMBER DEFAULT 0,
|
||||
ss_total_edits NUMBER DEFAULT 0,
|
||||
ss_good_articles NUMBER DEFAULT 0,
|
||||
ss_total_pages NUMBER DEFAULT -1,
|
||||
|
|
@ -257,10 +255,6 @@ CREATE TABLE &mw_prefix.site_stats (
|
|||
);
|
||||
CREATE UNIQUE INDEX &mw_prefix.site_stats_u01 ON &mw_prefix.site_stats (ss_row_id);
|
||||
|
||||
CREATE TABLE &mw_prefix.hitcounter (
|
||||
hc_id NUMBER NOT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE ipblocks_ipb_id_seq;
|
||||
CREATE TABLE &mw_prefix.ipblocks (
|
||||
ipb_id NUMBER NOT NULL,
|
||||
|
|
|
|||
|
|
@ -395,7 +395,6 @@ ss_active_users bigint INTEGER
|
|||
ss_good_articles bigint INTEGER
|
||||
ss_total_edits bigint INTEGER
|
||||
ss_total_pages bigint INTEGER
|
||||
ss_total_views bigint INTEGER
|
||||
ss_users bigint INTEGER
|
||||
|
||||
## True IP - keep an eye on these, coders tend to make textual assumptions
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ CREATE TABLE page (
|
|||
page_namespace SMALLINT NOT NULL,
|
||||
page_title TEXT NOT NULL,
|
||||
page_restrictions TEXT,
|
||||
page_counter BIGINT NOT NULL DEFAULT 0,
|
||||
page_is_redirect SMALLINT NOT NULL DEFAULT 0,
|
||||
page_is_new SMALLINT NOT NULL DEFAULT 0,
|
||||
page_random NUMERIC(15,14) NOT NULL DEFAULT RANDOM(),
|
||||
|
|
@ -262,7 +261,6 @@ CREATE INDEX langlinks_lang_title ON langlinks (ll_lang,ll_title);
|
|||
|
||||
CREATE TABLE site_stats (
|
||||
ss_row_id INTEGER NOT NULL UNIQUE,
|
||||
ss_total_views INTEGER DEFAULT 0,
|
||||
ss_total_edits INTEGER DEFAULT 0,
|
||||
ss_good_articles INTEGER DEFAULT 0,
|
||||
ss_total_pages INTEGER DEFAULT -1,
|
||||
|
|
@ -272,10 +270,6 @@ CREATE TABLE site_stats (
|
|||
ss_images INTEGER DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE hitcounter (
|
||||
hc_id BIGINT NOT NULL
|
||||
);
|
||||
|
||||
|
||||
CREATE SEQUENCE ipblocks_ipb_id_seq;
|
||||
CREATE TABLE ipblocks (
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ CREATE TABLE /*_*/page_tmp (
|
|||
page_namespace int NOT NULL,
|
||||
page_title varchar(255) binary NOT NULL,
|
||||
page_restrictions tinyblob NOT NULL,
|
||||
page_counter bigint unsigned NOT NULL default 0,
|
||||
page_is_redirect tinyint unsigned NOT NULL default 0,
|
||||
page_is_new tinyint unsigned NOT NULL default 0,
|
||||
page_random real unsigned NOT NULL,
|
||||
|
|
@ -164,7 +163,6 @@ CREATE INDEX /*i*/ll_lang_title ON /*_*/langlinks_tmp (ll_lang, ll_title);
|
|||
|
||||
CREATE TABLE /*_*/site_stats_tmp (
|
||||
ss_row_id int unsigned NOT NULL,
|
||||
ss_total_views bigint unsigned default 0,
|
||||
ss_total_edits bigint unsigned default 0,
|
||||
ss_good_articles bigint unsigned default 0,
|
||||
ss_total_pages bigint default '-1',
|
||||
|
|
|
|||
31
maintenance/sqlite/archives/patch-drop-page_counter.sql
Normal file
31
maintenance/sqlite/archives/patch-drop-page_counter.sql
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
-- field is deprecated and no longer updated as of 1.25
|
||||
CREATE TABLE /*_*/page_tmp (
|
||||
page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
page_namespace int NOT NULL,
|
||||
page_title varchar(255) binary NOT NULL,
|
||||
page_restrictions tinyblob NOT NULL,
|
||||
page_is_redirect tinyint unsigned NOT NULL default 0,
|
||||
page_is_new tinyint unsigned NOT NULL default 0,
|
||||
page_random real unsigned NOT NULL,
|
||||
page_touched binary(14) NOT NULL default '',
|
||||
page_links_updated varbinary(14) NULL default NULL,
|
||||
page_latest int unsigned NOT NULL,
|
||||
page_len int unsigned NOT NULL,
|
||||
page_content_model varbinary(32) DEFAULT NULL,
|
||||
page_lang varbinary(35) DEFAULT NULL
|
||||
) /*$wgDBTableOptions*/;
|
||||
|
||||
INSERT INTO /*_*/page_tmp
|
||||
SELECT page_id, page_namespace, page_title, page_restrictions, page_is_redirect,
|
||||
page_is_new, page_random, page_touched, page_links_updated, page_latest, page_len,
|
||||
page_content_model, page_lang
|
||||
FROM /*_*/page;
|
||||
|
||||
DROP TABLE /*_*/page;
|
||||
|
||||
ALTER TABLE /*_*/page_tmp RENAME TO /*_*/page;
|
||||
|
||||
CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title);
|
||||
CREATE INDEX /*i*/page_random ON /*_*/page (page_random);
|
||||
CREATE INDEX /*i*/page_len ON /*_*/page (page_len);
|
||||
CREATE INDEX /*i*/page_redirect_namespace_len ON /*_*/page (page_is_redirect, page_namespace, page_len);
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
-- field is deprecated and no longer updated as of 1.5
|
||||
CREATE TABLE /*_*/site_stats_tmp (
|
||||
ss_row_id int unsigned NOT NULL,
|
||||
ss_total_views bigint unsigned default 0,
|
||||
ss_total_edits bigint unsigned default 0,
|
||||
ss_good_articles bigint unsigned default 0,
|
||||
ss_total_pages bigint default '-1',
|
||||
|
|
@ -11,7 +10,7 @@ CREATE TABLE /*_*/site_stats_tmp (
|
|||
) /*$wgDBTableOptions*/;
|
||||
|
||||
INSERT INTO /*_*/site_stats_tmp
|
||||
SELECT ss_row_id, ss_total_views, ss_total_edits, ss_good_articles,
|
||||
SELECT ss_row_id, ss_total_edits, ss_good_articles,
|
||||
ss_total_pages, ss_users, ss_active_users, ss_images
|
||||
FROM /*_*/site_stats;
|
||||
|
||||
|
|
|
|||
21
maintenance/sqlite/archives/patch-drop-ss_total_views.sql
Normal file
21
maintenance/sqlite/archives/patch-drop-ss_total_views.sql
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
-- field is deprecated and no longer updated as of 1.25
|
||||
CREATE TABLE /*_*/site_stats_tmp (
|
||||
ss_row_id int unsigned NOT NULL,
|
||||
ss_total_edits bigint unsigned default 0,
|
||||
ss_good_articles bigint unsigned default 0,
|
||||
ss_total_pages bigint default '-1',
|
||||
ss_users bigint default '-1',
|
||||
ss_active_users bigint default '-1',
|
||||
ss_images int default 0
|
||||
) /*$wgDBTableOptions*/;
|
||||
|
||||
INSERT INTO /*_*/site_stats_tmp
|
||||
SELECT ss_row_id, ss_total_edits, ss_good_articles, ss_total_pages,
|
||||
ss_users, ss_active_users, ss_images
|
||||
FROM /*_*/site_stats;
|
||||
|
||||
DROP TABLE /*_*/site_stats;
|
||||
|
||||
ALTER TABLE /*_*/site_stats_tmp RENAME TO /*_*/site_stats;
|
||||
|
||||
CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
|
||||
|
|
@ -241,9 +241,6 @@ CREATE TABLE /*_*/page (
|
|||
-- can move or edit the page.
|
||||
page_restrictions tinyblob NOT NULL,
|
||||
|
||||
-- Number of times this page has been viewed.
|
||||
page_counter bigint unsigned NOT NULL default 0,
|
||||
|
||||
-- 1 indicates the article is a redirect.
|
||||
page_is_redirect tinyint unsigned NOT NULL default 0,
|
||||
|
||||
|
|
@ -704,9 +701,6 @@ CREATE TABLE /*_*/site_stats (
|
|||
-- The single row should contain 1 here.
|
||||
ss_row_id int unsigned NOT NULL,
|
||||
|
||||
-- Total number of page views, if hit counters are enabled.
|
||||
ss_total_views bigint unsigned default 0,
|
||||
|
||||
-- Total number of edits performed.
|
||||
ss_total_edits bigint unsigned default 0,
|
||||
|
||||
|
|
@ -733,19 +727,6 @@ CREATE TABLE /*_*/site_stats (
|
|||
-- Pointless index to assuage developer superstitions
|
||||
CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
|
||||
|
||||
|
||||
--
|
||||
-- Stores an ID for every time any article is visited;
|
||||
-- depending on $wgHitcounterUpdateFreq, it is
|
||||
-- periodically cleared and the page_counter column
|
||||
-- in the page table updated for all the articles
|
||||
-- that have been visited.)
|
||||
--
|
||||
CREATE TABLE /*_*/hitcounter (
|
||||
hc_id int unsigned NOT NULL
|
||||
) ENGINE=MEMORY MAX_ROWS=25000;
|
||||
|
||||
|
||||
--
|
||||
-- The internet is full of jerks, alas. Sometimes it's handy
|
||||
-- to block a vandal or troll account.
|
||||
|
|
|
|||
Loading…
Reference in a new issue