[ENG-10851](https://linear.app/comm/issue/ENG-10851/update-functions-that-can-be-executed-regardless-of-the-fact-whether).
We want all records from both tables (original + backup)
- UNION combines rows from both tables into a single result set
- JOIN would try to match records between tables (which isn't what we want)
- UNION ALL would be even better since we don't need to eliminate duplicates (backup and original should have different dat- UNION ALL wouldn't eliminate duplicates, backup and original should have different data, so probably doesn't matter much, but I think it is safer to use UNION
For messages & medias, there is no `select *` query but more specialized queries,; this is going to be handled as part of [ENG-9787](https://linear.app/comm/issue/ENG-9787/update-functions-that-read-from-the-db-to-be-aware-of-thread-thickness)
Depends on D14845