The magento_targetrule table has action_select and action_select_bind columns with queries that are bad formated with sql commands ad they're not important at all for crossel and upsell products.
Go on vendor/magento/module-target-rule/Model/ResourceModel/Index.php
Method protected function _getProductIdsByRule
On the method mentioned above you can validate which and what is the bad performatic sql is built.
You have the $actionSelect = $rule->getActionSelect(); that is ammended on where() collection query.
To fix that, set null on action_select, action_select_bind columns.