hyva-themes / magento2-hyva-admin

This module aims to make creating grids and forms in the Magento 2 adminhtml area joyful and fast.
https://hyva-themes.github.io/magento2-hyva-admin/
BSD 3-Clause "New" or "Revised" License
168 stars 39 forks source link

Avoid loading excluded fields #46

Open Vinai opened 3 years ago

Vinai commented 3 years ago

This issue was originally raised in this thread: https://github.com/hyva-themes/magento2-hyva-admin/issues/45#issuecomment-840436338

Here is a copy from there:

This is more related to performance and extra data that are never use in grid. Maybe more correct request here is extract only included fields if they are specified.

Precondition: you have a real catalog (not sample data) with 100 custom attributes, with assigned related, upsell, crosssell. You create a grid and specify only 20 attributes that are requires for you with includes.

Expected Result: the system processes (extract) only your specified attributes for render

Actual Result: the system processes all EAV attributes for each product individually and in case 50 products per page - try to load related, upsell, crosssell collections for each row.

Possible workaround: Defines event for hyva_grid_column_definition_build_after and remove all heavy columns or just keep specified in includes node.

I didn't check scenario (saw in examples) when specified additional filters which are not present in includes in columns