Open
Description
During the installation process of the plugin, it tries to download images and add them to the media repository (link). Before downloading the images, it checks the repository to see if they don't already exist.
$criteria = new Criteria();
$criteria->addFilter(new EqualsFilter('fileName', $fileName));
/** @var MediaCollection $icons */
$icons = $this->mediaRepository->search($criteria, $context);
if ($icons->count() && $icons->first() !== null) {
return $icons->first()->getId();
}
The fileName
field isn't indexed in MySQL by Shopware. As a result, the query it executes in the background takes 20 minutes per payment method on our test environment, which has about 400k entities in the media repository.