Skip to content

Instantly share code, notes, and snippets.

@andrewdaluz
Created May 1, 2021 03:39
Show Gist options
  • Save andrewdaluz/af4f614ccdcdaddef3002548debdb52f to your computer and use it in GitHub Desktop.
Save andrewdaluz/af4f614ccdcdaddef3002548debdb52f to your computer and use it in GitHub Desktop.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment