Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a lot of core/sql (Aimeos\MShop\Index\Manager\MySQL) error in log #358

Closed
parsester opened this issue Jan 10, 2021 · 8 comments
Closed

a lot of core/sql (Aimeos\MShop\Index\Manager\MySQL) error in log #358

parsester opened this issue Jan 10, 2021 · 8 comments

Comments

@parsester
Copy link

Environment

  1. Version 2020.10
  2. Operating system: CentOS 7

Describe the bug
I upgraded from 2020.07 to 2020.10 and after but now I see a lot of errors in logs which I attach an screenshot of those.
why this happen and how can fix it?

Screenshots
Snag_2973ae93

Additional context
Please keep in mind in your direction (https://aimeos.org/help/post13262.html#p13223) I made changes to my files for filter products by stock level that you announced that this feature will be added in the next version.

@aimeos
Copy link
Owner

aimeos commented Jan 11, 2021

These are slow queries (time: >1000ms) and are likely due to your join of the mshop_stock table. Try to add an appropriate index to speed them up.

@parsester
Copy link
Author

These are slow queries (time: >1000ms) and are likely due to your join of the mshop_stock table. Try to add an appropriate index to speed them up.

ok, but I make this change according to your guide in the https://github.com/aimeos/aimeos-laravel/issues/url, please say me how can I add an appropriate index?

@aimeos
Copy link
Owner

aimeos commented Jan 21, 2021

You are doing something that Aimeos isn't optimized for and that doesn't mean that everything works perfectly out of the box. You have to use "EXPLAIN" for the queries that take long to find out where the problem is why MySQL needs so long and add indexes if possible to speed up the MySQL query.

@parsester
Copy link
Author

You are doing something that Aimeos isn't optimized for and that doesn't mean that everything works perfectly out of the box. You have to use "EXPLAIN" for the queries that take long to find out where the problem is why MySQL needs so long and add indexes if possible to speed up the MySQL query.

please keep in mind i did not do this on my own, i just made the changes you said, please visit this link:
https://aimeos.org/help/help-f15/how-to-hide-unique-products-in-catalogue-when-they-are-sold-t1104.html#p13223
in this topic according to the request we had you say "It's not available in 2020.10 but we've implemented this feature in the dev-master branch now:" and you introduced changes to make:
https://github.com/aimeos/aimeos-core/commit/04e688a913263b6965b2f59b48e9a978bf85eca1
https://github.com/aimeos/ai-controller-frontend/commit/4e1b507ad577fd2d07a87bbb24e661e918408557
https://github.com/aimeos/ai-client-html/commit/90584da57b04958cdaf4a6126b9dac3377886364

and I made these changes to my code.

@aimeos
Copy link
Owner

aimeos commented Jan 26, 2021

Nevertheless, we've decided to revert the changes because it works with MySQL only - not with MariaDB, PostgreSQL and especially not with ElasticSearch and Solr. You can use the code for your own project but it won't be available in 2021.x due to the principle problems which arise with that feature.

We removed that code again because of multiple issues. Our current solution would be to add an "in-stock" attribute to the products and remove it again if the stock level reached 0. This is something that can be done in a decorator for the stock manager.

@parsester
Copy link
Author

We removed that code again because of multiple issues. Our current solution would be to add an "in-stock" attribute to the products and remove it again if the stock level reached 0. This is something that can be done in a decorator for the stock manager.

thanks for letting me know, in this case, I have a request from you, would you please help me?

  • can you add your solution ("add an "in-stock" attribute to the products and remove it again if the stock level reached 0" ) for version 2020.10.x? because it is an important feature.

  • in another way i want to add a cron job for product domain to run every 30 minutes (more or less) that search for products (as well as selection products) with stock-level 0 and set these products status = 0 to don't show in the categories and products list.
    can you please give me full code for this?

@aimeos
Copy link
Owner

aimeos commented Jan 28, 2021

  • can you add your solution ("add an "in-stock" attribute to the products and remove it again if the stock level reached 0" ) for version 2020.10.x? because it is an important feature.

Maybe but this has no priority for us and will only be available in 2021+
If you need it immediately, you can pay the Aimeos company for implementing that:
https://aimeos.com/aimeos-gmbh/contact

  • in another way i want to add a cron job for product domain to run every 30 minutes (more or less) that search for products (as well as selection products) with stock-level 0 and set these products status = 0 to don't show in the categories and products list.
    can you please give me full code for this?

Sorry, we are not here to do your job. If you can't do it yourself, ask the Aimeos company.

@aimeos aimeos closed this as completed Mar 10, 2021
@aimeos
Copy link
Owner

aimeos commented Sep 29, 2023

Since 2022.10, there's an product.instock value indicating if a product is in stock or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants