Description
This issue is automatically created based on existing pull request: #29692: Allow ignored columns for mview to be specified at the subscription level
Summary (*)
Magento 2.4-develop
Current configuration options for indexer subscriptions are limited - only allowing a table to be specified, rather than specific columns that we may be interested in.
Likewise \Magento\Framework\Mview\View\Subscription
has the argument $ignoredUpdateColumns
, which by default only includes updated_at
. This argument is used to ignore columns for update triggers globally.
This change adds another argument to \Magento\Framework\Mview\View\Subscription
to allow for columns to be ignored for a specific view/table combination (i.e. at the subscription level).
Example use-case:
You may wish to subscribe to the salesrule
table for a custom indexer (e.g. view id of "my_custom_view"), but with current functionality, this results in a reindex occurring any time an order is placed which had the rule applied, due to the times_used
column being updated.
With the following di.xml
entries, we can specifically ignore the times_used
column for our indexer view:
<type name="Magento\Framework\Mview\View\Subscription">
<arguments>
<argument name="ignoredUpdateColumnsBySubscription" xsi:type="array">
<item name="my_custom_view" xsi:type="array">
<item name="salesrule" xsi:type="array">
<item name="times_used" xsi:type="string">times_used</item>
</item>
</item>
</argument>
</arguments>
</type>
Examples (*)
- Add
di.xml
configuration for an existing view - e.g.cataloginventory_stock
:
<type name="Magento\Framework\Mview\View\Subscription">
<arguments>
<argument name="ignoredUpdateColumnsBySubscription" xsi:type="array">
<item name="cataloginventory_stock" xsi:type="array">
<item name="cataloginventory_stock_item" xsi:type="array">
<item name="low_stock_date" xsi:type="string">low_stock_date</item>
</item>
</item>
</argument>
</arguments>
</type>
- Set all indexers to update on save (this will remove existing triggers)
- Set all indexers to update by schedule (this will create triggers again)
- Observe that updating
cataloginventory_stock_item.low_stock_date
does not create a record incataloginventory_stock_cl
, but does create records incatalogsearch_fulltext_cl
andcatalog_product_price_cl
Proposed solution
Metadata
Metadata
Assignees
Labels
Type
Projects
Status