Open RoyalFoxy opened 1 day ago
As additional info:
On our production environment we have a customer that created an order with 17 surcharges and 15 order lines. The network time when executing OrderDetailQuery
is roughly 20s and without surcharges it's roughly 500ms
The same customer also created an order with 30 surcharges and 63 order lines. The server ends up running into a memory heap allocation error and crashes.
Note that our production uses postgres and the reproducible uses sqlite so that could also be a major factor why our production is this much slower but even with sqlite it's a significant slow down on an otherwise vanilla vendure instance.
Additionally we've ran some tests with the db query that seems to retrieve the majority of the data
This query takes 6.1s to complete where most of the time is spent sorting the order lines
And without the sort it takes 148ms
With the sort but without the surcharges in the same query the query takes 199ms
Also it's very weird that adding the surcharges increases the rows from around 3000 to over 50'000. These stats belong to the order with 17 surcharges and 15 order lines that takes around 12 seconds to complete on my machine and 20s on the production env
Thanks for this detailed report. Right now I have no idea why this performs in this way. Definitely needs some thorough further investigation.
Describe the bug Adding many surcharges to an order makes the retrieval of the order (with surcharges) significantly slower.
To Reproduce Steps to reproduce the behavior:
addSurchargeToOrder
graphql mutation 60 times to add 60 simple dummy surchargesOrderDetailQuery
(~200ms)OrderDetailQuery
without surcharges onOrder
typeOrderDetailQuery
(~25ms)Expected behavior The surcharges should not impact query time on the Order
Environment (please complete the following information):
Additional context Full reproducible