Skip to content

catalog_product_relation is unsuitable for mview. #31061

Open
@bricht

Description

@bricht

Summary (*)

I am trying to implement a custom indexer for 'Product Variants' as a part of these projects:
https://github.com/magento/catalog-storefront/ and https://github.com/magento/commerce-data-export

This indexer contains data on product variants / product relations.
In order to efficiently trigger a reindex in 'Update on Schedule' mode, I need to add an mview subscription to catalog_product_relation. Since SQL triggers do not work with ON DELETE CASCADE this is not possible at the moment.

Examples (*)

Proposed solution

I propose to remove the foreign keys and add an afterDelete() plugin, which deletes the entries from relation table, when the relevant products are deleted.

https://github.com/magento/partners-magento2ee/pull/426
#31048


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

    Labels

    Issue: ready for confirmationPriority: P3May be fixed according to the position in the backlog.Progress: PR in progressSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itfeature request

    Type

    No type

    Projects

    Status

    Pull Request in Progress

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions