1
votes

$contentCatalog=apparel-ukContentCatalog $contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Online])[default=$contentCatalog:Online]

INSERT_UPDATE TopSellingProductComponent;$contentCV[unique=true];uid[unique=true];name;numberofproducts ;;topSellingProductComponent;top Selling Product Component;10

error is:[type TopSellingProductComponent is abstract - no permitted type for mode import_strict]}, definition please how to fix it

2
select {p.pk} from {order as o join orderentry as oe on{oe.order}={o.pk} join product as p on {oe.product}={p.pk}} where {o.date}>startdate AND{o.date}<enddate group by{p.pk}order by count({oe.pk}) desc limit 10 ../// here i wan to add tha t one more step. is that check the status of the order with order status how can i check thatMani Sankar

2 Answers

0
votes

There is no simple way to optimize such a query.

You can build and maintain a Summary Table, then do the query from that table. This approach may achieve a 10-fold speedup.

More discussion: http://mysql.rjweb.org/doc.php/summarytables

0
votes

You can create a covering index that includes all fields referenced in the query. Note for a large table it may take a considerable amount of time to build such an index.

Once the index is created you can check the explain plan to confirm that the query is using the index.

Presuming the index is being used, the performance should be dramatically improved for select query.

It is possible that the index slows down high volume insert/update statements, so give this some consideration..