Speed up customer search on order creation #2524
Unanswered
GaryReckard
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a beefy customer/order database, and are experiencing some slowness in the order creation process when searching for or creating a new customer. When we enter in an email address, it can take many seconds for a response to come back about whether that customer exists yet.
I've tried looking for missing DB indexes that could speed up this query ...
commerce/src/services/Customers.php
Lines 672 to 692 in d8ab261
... butt I think the fact that the
LIKE
statement puts a%
before and after the search query has a lot to do with the slowness.It would be nice to have some config options around these searches; perhaps allowing us to choose what fields get searched, or customize whether the % comes at the front of the query, after, or both. In our case, we're pretty much only searching for emails, so searching within the billing or shipping addresses isn't helping.
Another idea I had for optimization... perhaps you could detect that the search query was a full email address, and if so, confine the search to only search the
orders
orusers
email field?Beta Was this translation helpful? Give feedback.
All reactions