In maintenance/postgres/tables.sql, the profiling table should be defined like
authorJeff Janes <jeff.janes@gmail.com>
Tue, 15 Oct 2013 20:19:10 +0000 (20:19 +0000)
committer[[mw:User:Valhallasw]] <gerritpatchuploader@gmail.com>
Tue, 15 Oct 2013 20:19:10 +0000 (20:19 +0000)
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
maintenance/postgres/archives/patch-profiling.sql
maintenance/postgres/tables.sql

index a4c9d74..79183da 100644 (file)
@@ -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' ),
index 1c4dce4..5a2710a 100644 (file)
@@ -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
 );
index 4d44705..766fc1f 100644 (file)
@@ -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
 );