Merge lp://qastaging/~wgrant/launchpad/bug-736005-trivialise into lp://qastaging/launchpad

Proposed by William Grant
Status: Work in progress
Proposed branch: lp://qastaging/~wgrant/launchpad/bug-736005-trivialise
Merge into: lp://qastaging/launchpad
Diff against target: 242 lines (+65/-119)
1 file modified
lib/lp/translations/model/pofile.py (+65/-119)
To merge this branch: bzr merge lp://qastaging/~wgrant/launchpad/bug-736005-trivialise
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+250447@code.qastaging.launchpad.net

Commit message

Rewrite the POFile:+translate text search query to perform adequately.

Description of the change

Rewrite translations text search to use the simplest query that can work, which happens to optimise best nowadays. The old code is littered with comments describing how simpler queries degrade to seqscans of POMsgID and POTranslation, but that's not the case in 9.3 with a sensible simple query.

https://pastebin.canonical.com/126018/ compares the new and old queries. Further optimisation will come soon once POTMsgSet.msgid_(singular|plural) are denormalised to TranslationTemplateItem, and the COUNT(*) queries are eliminated from large template views.

To post a comment you must log in.
17361. By William Grant

Drop duplicate join condition.

17362. By William Grant

Fix distinct by including TTI in the result.

17363. By William Grant

Don't double-join POMsgID and POTranslation.

Unmerged revisions

17363. By William Grant

Don't double-join POMsgID and POTranslation.

17362. By William Grant

Fix distinct by including TTI in the result.

17361. By William Grant

Drop duplicate join condition.

17360. By William Grant

Distinctify.

17359. By William Grant

Reimplement XPI translation search.

17358. By William Grant

Support multiple plural forms in search rewrite.

17357. By William Grant

Rewrite translation search to the simplest form that happens to perform a lot better than the old planner workarounds.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.