𝗧𝗵𝗲 𝗘𝗔𝗩 𝗧𝗮𝘅: 𝗪𝗵𝘆 𝗠𝗮𝗴𝗲𝗻𝘁𝗼 𝗽𝗿𝗼𝗱𝘂𝗰𝘁 𝗹𝗼𝗮𝗱𝘀 𝗮𝗿𝗲 𝘀𝗹𝗼𝘄

Magento users often complain about speed. Many of these users pay an EAV tax without knowing it.

A product in Magento is not a single row. It is a collection of rows scattered across many tables. One table holds static columns. Other tables hold specific data types like varchar, int, decimal, text, and datetime.

To load one product, Magento reads from every one of these tables. It then stitches them back into an object. If you add a store view, the work doubles.

The biggest trap is using addAttributeToSelect('*').

The asterisk means you load every attribute. If a category page shows 36 products, it might only need six fields like name and price. If you use the asterisk, you load sixty fields instead. Magento reads, joins, and processes fifty-four extra fields only to throw them away.

You can fix this in five minutes.

Stop using the asterisk. List the exact columns you need:

  • name
  • price
  • small_image
  • url_key
  • status
  • visibility

This change is the biggest win for slow listing pages.

For a deeper fix, do not reassemble products from EAV on listing pages. Category pages and search should read from index tables and OpenSearch. Magento maintains these indexes for you. A fast category page leans on these indexes and only touches EAV for the few attributes the template prints.

Do not use the flat catalog feature. Adobe deprecated it because it fails when you have many attributes. It adds heavy indexing work and hits MySQL column limits.

Follow these rules for better performance:

  • Select named attributes only. Never use the asterisk in collections that render to users.
  • Use OpenSearch for listing and filtering.
  • For bulk exports, use keyset pagination by entity_id.
  • Select only the fields you need for exports.

Measure your results. Turn on your query log. If a single category page fires hundreds of queries, EAV reassembly is the cause. You now know how to find the line of code causing the problem.

Source: https://dev.to/iamrobindhiman/the-eav-tax-why-magento-product-loads-are-slow-117h