From 64fbe6a89bc22ba5ce22dcadbaedb9381afb79d6 Mon Sep 17 00:00:00 2001 From: Jeff Janes Date: Tue, 15 Oct 2013 20:19:10 +0000 Subject: [PATCH] In maintenance/postgres/tables.sql, the profiling table should be defined like this: CREATE TABLE profiling ( pf_count INTEGER NOT NULL DEFAULT 0, pf_time FLOAT NOT NULL DEFAULT 0, pf_memory FLOAT NOT NULL DEFAULT 0, pf_name TEXT NOT NULL, pf_server TEXT NULL ); The current use of NUMERIC(18,10) very rapidly overflows the pf_memory column, generating errors. Also, the NUMERIC is very much slower than float, and in this case it has no advantages. Bug: 55722 Change-Id: I48b00d55aaed821a4ceb9365033817a3b477d71a --- includes/installer/PostgresUpdater.php | 2 ++ maintenance/postgres/archives/patch-profiling.sql | 3 ++- maintenance/postgres/tables.sql | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index a4c9d74515..79183da3ca 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -205,6 +205,8 @@ class PostgresUpdater extends DatabaseUpdater { array( 'changeField', 'templatelinks', 'tl_namespace', 'smallint', 'tl_namespace::smallint' ), array( 'changeField', 'user_newtalk', 'user_ip', 'text', 'host(user_ip)' ), array( 'changeField', 'uploadstash', 'us_image_bits', 'smallint', '' ), + array( 'changeField', 'profiling', 'pf_time', 'float', '' ), + array( 'changeField', 'profiling', 'pf_memory', 'float', '' ), # null changes array( 'changeNullableField', 'oldimage', 'oi_bits', 'NULL' ), diff --git a/maintenance/postgres/archives/patch-profiling.sql b/maintenance/postgres/archives/patch-profiling.sql index 1c4dce4e28..5a2710a861 100644 --- a/maintenance/postgres/archives/patch-profiling.sql +++ b/maintenance/postgres/archives/patch-profiling.sql @@ -1,6 +1,7 @@ CREATE TABLE profiling ( pf_count INTEGER NOT NULL DEFAULT 0, - pf_time NUMERIC(18,10) NOT NULL DEFAULT 0, + pf_time FLOAT NOT NULL DEFAULT 0, + pf_memory FLOAT NOT NULL DEFAULT 0, pf_name TEXT NOT NULL, pf_server TEXT NULL ); diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index 4d44705c76..766fc1f9ef 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -585,8 +585,8 @@ $mw$; -- This table is not used unless profiling is turned on CREATE TABLE profiling ( pf_count INTEGER NOT NULL DEFAULT 0, - pf_time NUMERIC(18,10) NOT NULL DEFAULT 0, - pf_memory NUMERIC(18,10) NOT NULL DEFAULT 0, + pf_time FLOAT NOT NULL DEFAULT 0, + pf_memory FLOAT NOT NULL DEFAULT 0, pf_name TEXT NOT NULL, pf_server TEXT NULL ); -- 2.20.1