-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
NEXT-34070 - Improve seo url replacer #3579
Conversation
28c5ae3
to
9016740
Compare
9016740
to
b05d613
Compare
c9666ff
to
08055ba
Compare
08055ba
to
924d190
Compare
Hi @akf-bw
|
There was no limit in the original query. However, it was also not possible to add a limit in the original query because that query retrieved filled salesChannelId's and empty salesChannelIds at the same time, so there are multiple lines for a path_info. In my local test environment, the original query returned a list of approximately 110,000 rows per request.
I don't need to add an additional limit to the new queries because the $mapping variable already defines how many rows are possible. |
924d190
to
f7d4e2d
Compare
Yeah I mean to set the limit in the original query and call it twice with different salesChannelId parameters (similar to your solution but we don't need the subqueries). But your sub-query solution would also be good. Could you add the unit test to cover your changes? |
I already tested this. For this to work you also need to add "GROUP BY path_info" so that the limit can work correctly. This grouping is extremely slow and took about twice as long as the old query, so this wasn't a solution.
I'll take a look at this. |
@vienthuong There is already the |
@vienthuong I again tested with the query params. If we include the params directly like this, we could save up to 1-5ms per |
In this particular case, the performance difference is not significant and using Uuid::fromHexToBytes would be safer. We will also evaluate it if it would be a good idea and worth the effort to use concatted string instead of the hex2bin method as we have used it everywhere |
f7d4e2d
to
6f85ed5
Compare
@vienthuong I just removed one of the foreach loops since we can move the behavior into the loop beforehand. |
Hi @akf-bw, looks very good so far. |
Hello, thank you for creating this pull request. Please use this issue to track the state of your pull request. |
We did evaluate the performance gains by using/not using Uuid::fromHexToBytes and it's insignificant unless you have millions of UUIDs. So for now we will keep using the method to have safer/standard UUIDs in the query. |
Your PR has been merged. Thank you for your contribution 🎉 💙 |
I've tried this change and now the query is slower ... Mappings: Shopware: 6.5.8.6 |
Hi @akf-bw could you also benchmark your instance with the latest source code? |
@tamvt @vienthuong Could you please revert the PR changes in the trunk branch for now. I'll have to check what caused this different behavior in my environment. |
1. Why is this change necessary?
Before:


After:
(
seo_url entries: ~380.000
)2. What does this change do, exactly?
createSeoMapping
method inSeoUrlPlaceholderHandler
to use subqueries3. Describe each step to reproduce the issue or behaviour.
4. Please link to the relevant issues (if any).
/
5. Checklist