Use CTE (or parent_id keymap) to get the related terms and their ancestors on the search populate task
|Category:||Performance / scalability|
|Google Code Legacy ID:||Tested version:|
Steve recently improved the process to get the related terms and their ancestors when the archival descriptions are indexed (see #13175). This is a major improvement on the full indexing task but it may not be such on a single description index. AtoM 2.6 will require MySQL 8.0 and we could use CTEs to fetch the terms and ancestors, which may be a better improvement to index a single description.
Either way, the final fix should also be added to the similar query used on the actors index process.