Hallo zusammen,
einer unserer Kunden hat massivste Performance-Probleme mit dem Kategorielisting.
Die Kategorie enthält 700 Produkte mit eindimensionalen Varianten. Es gibt 6 Filter, jeder Filter hat so 5 bis 30 Ausprägungen.
Die Kategorie braucht 20 Sekunden, um zu laden.
Als „Übeltäter“ habe ich die Stelle $aggregations = $this->repository->aggregate($criteria, $context); in der load-Methode der Klasse Content/Product/SalesChannel/Listing/ProductListingLoader.php ausfindig gemacht.
Insgesamt werden 5 Aggregations geladen, eine Aggregation erstellt bspw. folgenden Query (vereinfacht, wollte nicht alle Parameter auflösen):
SELECT LOWER(HEX(`product.properties`.`id`)) AS `properties.key`,
COUNT(`product`.`id`) AS `properties.count`
FROM `product`
LEFT JOIN `product` `product.parent` ON `product`.`parent_id` = `product.parent`.`id`
AND `product`.`version_id` = `product.parent`.`version_id`
LEFT JOIN `product_price` `product.prices` ON `product`.`prices` = `product.prices`.`product_id`
AND `product`.version_id = `product.prices`.product_version_id
LEFT JOIN `product_visibility` `product.visibilities` ON `product`.`visibilities` = `product.visibilities`.`product_id`
AND `product`.version_id = `product.visibilities`.product_version_id
LEFT JOIN
(SELECT `product.properties.mapping`.`product_id` AS id,
`product.properties.mapping`.`product_version_id`
FROM `product_property` `product.properties.mapping`
LEFT JOIN `property_group_option` `product.properties` ON `product.properties.mapping`.`property_group_option_id` = `product.properties`.`id`
WHERE (`product.properties`.`id` IN ("?",
"?",
"?",
"?",
"?",
"?",
"?"))) `product.properties_1` ON `product`.`properties` = `product.properties_1`.`id`
AND `product`.`version_id` = `product.properties_1`.`product_version_id`
LEFT JOIN `product_property` `product.properties.mapping` ON `product`.`properties` = `product.properties.mapping`.`product_id`
AND `product`.`version_id` = `product.properties.mapping`.`product_version_id`
LEFT JOIN `property_group_option` `product.properties` ON `product.properties.mapping`.`property_group_option_id` = `product.properties`.`id`
WHERE (`product`.`version_id` = 0x0fa91ce3e96a4bc2be4bd9ce752c3425)
AND ((`product.prices`.`rule_id` IN (0x7af08a1a27cf4264b988bde30a3fd7df)
AND ((`product.visibilities`.`visibility` >= 30)
AND `product.visibilities`.`sales_channel_id` = 0x4ab3abf38b5f4d34939c6da8ceb5b884
AND IFNULL(`product`.`active`, `product.parent`.`active`) = 1)
AND ((IFNULL(`product`.`active`, `product.parent`.`active`) = 1
AND NOT (`product.properties_1`.id IS NOT NULL)))
AND NOT (`product`.`display_group` <=> 1)))
AND ((`product.properties`.`property_group_id` IN (0x32decff511bf4eea923bbe676a7f094a,
0x53fc59189795465e8c635281f6ba77f9,
0x2ad0bd9c83e440a18f44e19373ffa573,
0xddc7031e68a44db7a456d86debcee8b2,
0x4fc24afd666d454aa509816d240d8344,
0x5ca55f3b336d4796b6f24d6afa1c2b19,
0x1a951f3d3a424b00bf8a8db16a8e96cd,
0x69a8044d19cc4414b40e9d5a1d1833c1)))
GROUP BY `product.properties`.`id`
und hat eine Ladezeit von mehreren Sekunden.
Der Kunde nutzt noch die 6.4.3.1. In diesem Release gab es bereits einen Fix der Listing-Performance (Shopware Issuetracker), das ist hier also nicht das Problem.
Jemand eine Idee? Derzeit springen quasi alle Kunden ab, weil die Seite nicht bedienbar ist.
Viele Grüße,
Malte