POFile queries are not using partial indexes well

Bug #369748 reported by Данило Шеган
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Данило Шеган

Bug Description

With message sharing switchover landed, POFile.getPOTMsgSet*() methods do not make best use of partial indexes in all cases. We should avoid using "something.variant NOT DISTINCT FROM other.variant", AND whenever we have direct values for eg. language or potemplate, we should use that in subselects instead of depending on postgres to be smart when we have that in the outer select and use something.language=outerTM.language.

This happens a lot with getPOTMsgSetWithNewSuggestions and updateStatistics (which makes use of all the methods above).

A workaround is to prepare a bigger, non-partial index like

CREATE INDEX translationmessage__potmsgset__language__idx ON translationmessage USING btree(potmsgset,language);

but we should also make sure queries are using partial indexes for a much better performance.

OOPS-1216D236 OOPS-1216B466 OOPS-1216E469 OOPS-1216B467 seem related (if you look at QUERY_STRING, there's either show=new_suggestions or show=changed_in_launchpad: OOPSes with "show=untranslated" seem to be about caching problems but might be related as well, just like search OOPS-1216H360 is likely to be).

Revision history for this message
Данило Шеган (danilo) wrote :

Stuart will add a workaround index to production database.

Changed in rosetta:
assignee: nobody → Данило Шеган (danilo)
importance: Undecided → High
milestone: none → 2.2.5
status: New → Triaged
tags: added: oops timeout
Revision history for this message
Данило Шеган (danilo) wrote :

This is likely the cause of bug #361844 as well.

tags: added: message-sharing
Revision history for this message
Данило Шеган (danilo) wrote :

Fixed in devel 8414. We should watch how new queries are using partial indexes (compared to the full one).

Changed in rosetta:
status: Triaged → Fix Committed
Changed in rosetta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.