-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance degradation in Layered navigation using Yes/No attribute #21771
Comments
Hi @stkec. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @stkec do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @sivaschenko. Thank you for working on this issue.
|
Hi @stkec. Thank you for your report.
The fix will be available with the upcoming 2.3.2 release. |
Relates to #20969 and #3283
Preconditions
Steps to reproduce
Expected result
Actual result (
Root of a problem
After #3283 merged it is possible to use Yes/No attributes in Layered Navigation. But when MySql engine assembles the SQL query there are 2 more places where FrontendInput of the Layered Navigation Attribute is hardcoded as ['select', 'multiselect']. As a result, Yes/No attribute processed not as a 'Term' condition as it suppose to be for Layered Attribute but as a default unknown condition. In the end search query assembled as following:
Notice following in the 'WHERE' condition:
The
catalog_product_entity_int
joined twice with 'HAVING' condition making this request vary hard to optimize for MySql.The Fix
In Magento\CatalogSearch\Model\Adapter\Mysql\Filter\Preprocessor.php and Magento\CatalogSearch\Model\Search\CustomAttributeFilterCheck.php add 'boolean' to the Frontend Input array.
This will guide engine to handle Yes/No attributes same as select or multiselect - joining from
catalog_product_index_eav
table.No double join with having - no performance struggling.
The text was updated successfully, but these errors were encountered: