Skip to content
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

Ecommerce Performance | Cart Queries should use index #5476

Open
andreas-gruenwald opened this issue Dec 18, 2019 · 1 comment
Open

Ecommerce Performance | Cart Queries should use index #5476

andreas-gruenwald opened this issue Dec 18, 2019 · 1 comment
Assignees
Labels

Comments

@andreas-gruenwald
Copy link
Contributor

@andreas-gruenwald andreas-gruenwald commented Dec 18, 2019

Performance Improvement

Problem Summary

Every cart load includes loading all cart items. Slow query log analysis shows that in webshops typically

  • cart items are loaded frequently.
  • the query for loading cart items currently does not utilize any SQL index.

Problem Details

Those are two of the queries that do not use an index:

SELECT cartid, itemKey, parentItemKey FROM ecommerceframework_cartitem WHERE cartId =2232 AND parentItemKey = ''  ORDER BY `sortIndex` ASC, `addedDateTimestamp` ASC;
SELECT COUNT(*) as amount FROM `ecommerceframework_cartitem` WHERE cartId = '2246' AND parentItemKey = '';

Solution Concept

Add an additional index to the cartitem table:

ALTER TABLE `ecommerceframework_cartitem` ADD INDEX `cartIdIndex` (`cartId`,`parentItemKey`);

This statement should be added to the Pimcore (migrations?).

@brusch

This comment has been minimized.

Copy link
Member

@brusch brusch commented Dec 18, 2019

Installer + migration script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.