← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stub/launchpad/pending-db-changes into lp:launchpad/db-devel

 

Stuart Bishop has proposed merging lp:~stub/launchpad/pending-db-changes into lp:launchpad/db-devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stub/launchpad/pending-db-changes/+merge/93213

= Summary =

wgrant identified a query chewing up excessive time in the planner. Approx. 30ms is spent per 100 samples in the planner, adding up since the default was 2500.

== Proposed fix ==

Lowering the collected statistics on one column works around the issue. This should stop these particular timeouts while I assemble a test case to pass upstream.

== Pre-implementation notes ==

== Implementation details ==

== Tests ==

== Demo and Q/A ==


= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/schema/patch-2209-00-7.sql


== Schema ==

database/sampledata/current.sql
    database/sampledata/lintdata.sql differs from database/sampledata/current.sql.
    Patches to the schema, or manual edits to database/sampledata/current.sql
    do not match the dump of the launchpad_ftest_template database.
    If database/sampledata/lintdata.sql is correct, copy it to
    database/sampledata/current.sql.
    Otherwise update database/sampledata/current.sql and run:
        make schema
        make newsampledata
        cd database/sampledata
        cp newsampledata.sql database/sampledata/current.sql
    Run make schema again to update the test/dev database.

database/sampledata/current.sql
    database/sampledata/lintdata-dev.sql differs from database/sampledata/current-dev.sql.
    Patches to the schema, or manual edits to database/sampledata/current-dev.sql
    do not match the dump of the launchpad_dev_template database.
    If database/sampledata/lintdata-dev.sql is correct, copy it to
    database/sampledata/current-dev.sql.
    Otherwise update database/sampledata/current-dev.sql and run:
        make schema
        make newsampledata
        cd database/sampledata
        cp newsampledata-dev.sql database/sampledata/current-dev.sql
    Run make schema again to update the test/dev database.
-- 
https://code.launchpad.net/~stub/launchpad/pending-db-changes/+merge/93213
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stub/launchpad/pending-db-changes into lp:launchpad/db-devel.
=== added file 'database/schema/patch-2209-00-7.sql'
--- database/schema/patch-2209-00-7.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-00-7.sql	2012-02-15 14:42:30 +0000
@@ -0,0 +1,7 @@
+SET client_min_messages=ERROR;
+
+-- Lower gathered statistics on this column to work around extreme planning
+-- times issue being investigated.
+ALTER TABLE TeamMembership ALTER person SET STATISTICS 100;
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 00, 7);