Skip to content

Consider adding a unique key to catalog_product_entity_media_gallery_value #36190

Open
@Nuranto

Description

@Nuranto

Summary (*)

Magento 2.4.5

I'm currently inspecting performances and I found this :
Capture d’écran 2022-09-23 à 18 51 04

Which leads to a loading time of 40 seconds for a product page, caused by Magento\Catalog\Model\Product\Gallery\ReadHandler::sortMediaEntriesByPosition.

The issue is that for some reason I cannot explain at the moment, I have duplicated content in my catalog_product_entity_media_gallery_value table :
Capture d’écran 2022-09-23 à 18 52 54

It is probably from a third-part extension, or maybe data-migration-tools, but the thing is that should not be allowed.

Proposed solution

=> We should transform CAT_PRD_ENTT_MDA_GLR_VAL_ENTT_ID_VAL_ID_STORE_ID index into a unique index.

Additional Informations

I don't know why this usort exists, since a sort is already made in the SQL query.


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users with no workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready for Grooming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions