1

ich arbeite derzeit an einem Magento 2-Projekt und stehe vor einer Herausforderung im Bereich der Datenarchitektur, speziell im Hinblick auf das Entity-Attribute-Value (EAV)-Modell, das Magento verwendet. Mein Ziel ist es, die Abfrageeffizienz für Produkte mit einer großen Anzahl an benutzerdefinierten Attributen zu optimieren. Ich habe festgestellt, dass Standardabfragen bei umfangreichen Attributsets langsam werden, was die Performance unserer Shop-Seite beeinträchtigt.

Meine Frage ist zweiteilig:

Gibt es bewährte Methoden zur Optimierung von SQL-Abfragen in Magento 2, insbesondere wenn es um das Abfragen von Produkten mit vielen benutzerdefinierten EAV-Attributen geht? Ich suche nach Möglichkeiten, die Abfragegeschwindigkeit zu verbessern, ohne die Flexibilität des EAV-Modells zu verlieren.

Wäre es sinnvoll, ein eigenes Datenmodell parallel zum EAV-Modell zu implementieren, das für bestimmte Abfragetypen optimiert ist? Ich denke hier an eine Art hybrides Modell, das die Vorteile des EAV für Flexibilität mit einem effizienteren, aber weniger flexiblen Modell für schnelle Abfragen kombiniert. Hat jemand Erfahrungen mit einem solchen Ansatz oder könnte potenzielle Fallstricke aufzeigen?

Jegliche Einblicke oder Vorschläge aus der Community wären sehr hilfreich.

Danke im Voraus!

+++++++++

English Version:

I am currently working on a Magento 2 project and am facing a challenge in the area of data architecture, specifically regarding the Entity-Attribute-Value (EAV) model that Magento uses. My goal is to optimize query efficiency for products with a large number of custom attributes. I've found that standard queries become slow with extensive attribute sets, which affects the performance of our shop page.

My question is twofold:

Are there proven methods for optimizing SQL queries in Magento 2, especially when it comes to querying products with many custom EAV attributes? I am looking for ways to improve query speed without losing the flexibility of the EAV model.

Would it be sensible to implement a separate data model alongside the EAV model, optimized for certain types of queries? I am thinking of a kind of hybrid model that combines the advantages of EAV for flexibility with a more efficient, but less flexible model for fast queries. Does anyone have experience with such an approach or could point out potential pitfalls?

Any insights or suggestions from the community would be very helpful.

Thanks in advance!

  • 2
  • Your life is complicated enough without another effort to improve speed. Turn on the Slow Query Log with a long_query_time of 1 second. For ONE query that is slow, for EACH table used post TEXT results of, A) SHOW CREATE TABLE tbl_name; and B) SHOW TABLE STATUS WHERE name LIKE "tbl_name"; and C) EXPLAIN SELECT SQL_NO_CACHE (rest of your query); and indicate how much time it took to complete the query, please. Someone will help you. Welcome to MSE. – Wilson Hauck Nov 23 '23 at 02:09
  • I’m voting to close this question because you need tu update the content only in english language – PЯINCƎ Nov 30 '23 at 21:43

0 Answers0