← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~danilo/launchpad/drop-variants into lp:launchpad

 

The proposal to merge lp:~danilo/launchpad/drop-variants into lp:launchpad has been updated.

Description changed to:

= Removal of variants =

We've long ago done away with TranslationMessage.variant and POFile.variant usage, but because of the migration, we haven't really dropped the DB columns.  Because of the migration script, we've also had to leave interface and model definitions in.

Now we can finally get rid of it all.  When we drop DB columns, we also lose all the indexes that refer to it. They are critical to LP Translations performance so we have to recreate them.

However, since new index creation takes a long time (one test run on staging took ~20 minutes, though it used to take even longer in the past so it's hard to estimate), I split it all into two DB patches: one that creates the new indexes without referencing any of the variant fields, and another which drops the columns.  New indexes do not conflict existing ones, so we can manually apply the first of the patches to the production DBs (both master and slaves, I am sure Stuart knows best how to do that), thus avoiding the need to run long DB update during rollout.

There are no comments.sql entries that need removing (I checked :).

= Timings from staging =

CREATE UNIQUE INDEX pofile__potemplate__language__idx
   ON pofile USING btree (potemplate, language);
Time: 8203.280 ms

CREATE UNIQUE INDEX tm__potmsgset__language__shared__current__key ON translationmessage USING btree (potmsgset, language) WHERE (((is_current IS TRUE) AND (potemplate IS NULL)));
Time: 256642.654 ms

CREATE UNIQUE INDEX tm__potmsgset__language__shared__imported__key ON translationmessage USING btree (potmsgset, language) WHERE (((is_imported IS TRUE) AND (potemplate IS NULL)));
Time: 190977.439 ms

CREATE INDEX tm__potmsgset__language__not_used__idx ON translationmessage USING btree (potmsgset, language) WHERE (NOT ((is_current IS TRUE) AND (is_imported IS TRUE)));
Time: 114520.636 ms

CREATE UNIQUE INDEX tm__potmsgset__potemplate__language__diverged__current__idx ON translationmessage USING btree (potmsgset, potemplate, language) WHERE (((is_current IS TRUE) AND (potemplate IS NOT NULL)));
Time: 103551.519 ms

CREATE UNIQUE INDEX tm__potmsgset__potemplate__language__diverged__imported__idx ON translationmessage USING btree (potmsgset, potemplate, language) WHERE (((is_imported IS TRUE) AND (potemplate IS NOT NULL)));
Time: 82104.305 ms

CREATE INDEX translationmessage__language__submitter__idx ON translationmessage USING btree (language, submitter);
Time: 463969.586 ms


-- 
https://code.launchpad.net/~danilo/launchpad/drop-variants/+merge/40735
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~danilo/launchpad/drop-variants into lp:launchpad.



References