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

GetAvailableSerialsOfEsd function is very slow #2594

Open
mitelg opened this issue Sep 20, 2023 · 0 comments
Open

GetAvailableSerialsOfEsd function is very slow #2594

mitelg opened this issue Sep 20, 2023 · 0 comments

Comments

@mitelg
Copy link
Contributor

mitelg commented Sep 20, 2023

sOrder::getAvailableSerialsOfEsd

starts working slowly when the number of the license keys in DB increases and that causes the clients to wait about 1 to 2 minutes in order to receive the order. (the number of purchased product keys in DB is about 20,000). These all is caused by LEFT JOIN query in SQL.
Suggestion: Replace the LEFT JOIN with another code given bellow.

return $this->db->fetchAll(
    'SELECT s_articles_esd_serials.id AS id, s_articles_esd_serials.serialnumber AS serialnumber
     FROM s_articles_esd_serials
     WHERE NOT s_articles_esd_serials.id IN (SELECT serialID FROM s_order_esd)
     AND s_articles_esd_serials.esdID= :esdId', 
    ['esdId' => $esdId]
);
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

1 participant