Skip to content

Table enqueue slow because of missing index on delivery_id #1190

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

Closed
commercewerft opened this issue Aug 6, 2021 · 0 comments
Closed

Table enqueue slow because of missing index on delivery_id #1190

commercewerft opened this issue Aug 6, 2021 · 0 comments

Comments

@commercewerft
Copy link

Background is a shopware 6.4 installation. We have 3.4 million entries in the mysql table enqueue.

A query like: DELETE FROM enqueue WHERE delivery_id = '1ea18942-283b-4cfd-a24a-1bf9917a9d0f'

takes 20-60 seconds. CPU load is by 100%. So this provides a race condition as the enqueue-table is growing fast and deleting entries is very slow.

Creating directly in mysql an index on delivery_id solves the problem. Queries are again done in milliseconds.

I think, there should be added an index on delivery_id in enqueue/dbal/DbalContext.php

enqueue_slow_queries

commercewerft pushed a commit to commercewerft/enqueue-dev that referenced this issue Aug 6, 2021
makasim added a commit that referenced this issue Aug 8, 2021
#1190 add index on delivery_id to prevent slow queries
@makasim makasim closed this as completed Sep 1, 2021
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