Search timeouts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Данило Шеган |
Bug Description
We're seeing some timeouts on POFile:+translate pages, coming from translations search. Message sharing introduced an extra join into the search query.
The query is huge, and the plan atrocious. Surprisingly, the unacceptable costs all seem to be in the POTMsgSet search—not in the translations search. There are several seq scans on potmsgset, all inside nested loops. The subplan that identifies the POTMsgSets for the incumbent template is not materialized and reused.
Low-hanging fruit:
* Materialize the scan for (non-obsolete) POTMsgSets in the template, instead of duplicating it. (Saves one POTMsgSet seq scan and some bitmap scans on TranslationTemp
* When checking "msgid_
* The POMsgID seq scan for matches is slow. For plurals, the plan first limits the search to ones belonging to relevant POTMsgSets which makes it much faster. See if we can get the same in the plan for singulars, or if we can't, either materialize into a temp table or replace the union of the msgid_singular and msgid_plural subqueries with a single query (using either OR or a double LEFT JOIN).
OOPS-1360G1367 OOPS-1360C2163 OOPS-1360F1125
tags: | added: timeout |
Changed in rosetta: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in rosetta: | |
assignee: | nobody → Данило Шеган (danilo) |
Changed in rosetta: | |
status: | Triaged → In Progress |
Changed in rosetta: | |
milestone: | 3.0 → 3.1.10 |
У пон, 04. 05 2009. у 11:25 +0000, Jeroen T. Vermeulen пише: {singular, plural} IN (...)," don't check for {singular, plural} IS NOT NULL" as well. (One seq scan on
>
> * When checking "msgid_
> "msgid_
> POTMsgSet happens there).
We can probably avoid seqscans just with clause reordering. That's what
usually helped.
> * The POMsgID seq scan for matches is slow. For plurals, the plan
> first limits the search to ones belonging to relevant POTMsgSets which
> makes it much faster. See if we can get the same in the plan for
> singulars, or if we can't, either materialize into a temp table or
> replace the union of the msgid_singular and msgid_plural subqueries
> with a single query (using either OR or a double LEFT JOIN).
Actually, it used to be a LEFT JOIN, but UNION performed much better on
staging during initial testing, which is why I rewrote the query as a
UNION.
Considering we are seeing only a few of these, I wouldn't consider this
very important unless we get >10 timeouts a day.