The POTemplate and POFile are fixed and known when the query is constructed, so we can strip those out of the query:
SELECT
POMsgId.msgid AS msgid,
POMsgID_Plural.msgid AS msgid_plural,
context,
date_reviewed,
is_current,
is_imported,
pt0.translation AS translation0,
pt1.translation AS translation1,
pt2.translation AS translation2,
pt3.translation AS translation3,
pt4.translation AS translation4,
pt5.translation AS translation5
FROM POTMsgSet
JOIN TranslationTemplateItem ON
TranslationTemplateItem.potmsgset = POTMsgSet.id AND
TranslationTemplateItem.potemplate = %(potemplate)s
JOIN TranslationMessage ON
POTMsgSet.id=TranslationMessage.potmsgset AND
(TranslationMessage.potemplate = %(potemplate)s OR
TranslationMessage.potemplate IS NULL) AND
TranslationMessage.language = %(language)s AND
TranslationMessage.variant IS NOT DISTINCT FROM %(variant)s
LEFT OUTER JOIN POTranslation pt0 ON pt0.id = TranslationMessage.msgstr0
LEFT OUTER JOIN POTranslation pt1 ON pt1.id = TranslationMessage.msgstr1
LEFT OUTER JOIN POTranslation pt2 ON pt2.id = TranslationMessage.msgstr2
LEFT OUTER JOIN POTranslation pt3 ON pt3.id = TranslationMessage.msgstr3
LEFT OUTER JOIN POTranslation pt4 ON pt4.id = TranslationMessage.msgstr4
LEFT OUTER JOIN POTranslation pt5 ON pt5.id = TranslationMessage.msgstr5
JOIN POMsgID ON
POMsgID.id=POTMsgSet.msgid_singular
LEFT OUTER JOIN POMsgID AS POMsgID_Plural ON
POMsgID_Plural.id=POTMsgSet.msgid_plural
WHERE (is_current IS TRUE OR is_imported IS TRUE)
ORDER BY
TranslationTemplateItem.sequence,
TranslationMessage.potemplate NULLS LAST
The POTemplate and POFile are fixed and known when the query is constructed, so we can strip those out of the query:
SELECT Plural. msgid AS msgid_plural, lateItem ON TemplateItem. potmsgset = POTMsgSet.id AND TemplateItem. potemplate = %(potemplate)s id=TranslationM essage. potmsgset AND nMessage. potemplate = %(potemplate)s OR nMessage. potemplate IS NULL) AND Message. language = %(language)s AND Message. variant IS NOT DISTINCT FROM %(variant)s age.msgstr0 age.msgstr1 age.msgstr2 age.msgstr3 age.msgstr4 age.msgstr5 id=POTMsgSet. msgid_singular Plural. id=POTMsgSet. msgid_plural TemplateItem. sequence, Message. potemplate NULLS LAST
POMsgId.msgid AS msgid,
POMsgID_
context,
date_reviewed,
is_current,
is_imported,
pt0.translation AS translation0,
pt1.translation AS translation1,
pt2.translation AS translation2,
pt3.translation AS translation3,
pt4.translation AS translation4,
pt5.translation AS translation5
FROM POTMsgSet
JOIN TranslationTemp
Translation
Translation
JOIN TranslationMessage ON
POTMsgSet.
(Translatio
Translatio
Translation
Translation
LEFT OUTER JOIN POTranslation pt0 ON pt0.id = TranslationMess
LEFT OUTER JOIN POTranslation pt1 ON pt1.id = TranslationMess
LEFT OUTER JOIN POTranslation pt2 ON pt2.id = TranslationMess
LEFT OUTER JOIN POTranslation pt3 ON pt3.id = TranslationMess
LEFT OUTER JOIN POTranslation pt4 ON pt4.id = TranslationMess
LEFT OUTER JOIN POTranslation pt5 ON pt5.id = TranslationMess
JOIN POMsgID ON
POMsgID.
LEFT OUTER JOIN POMsgID AS POMsgID_Plural ON
POMsgID_
WHERE (is_current IS TRUE OR is_imported IS TRUE)
ORDER BY
Translation
Translation