-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Switch order search to using starts over cont #1660
Switch order search to using starts over cont #1660
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I think the order number and shipment number might as well be a plain ==
, but let's ship this change first and see if this causes anyone any hardships. The only field here I think might be useful to do a "contains" instead of a "start" is email.
Can this get a CHANGELOG entry?
Sure thing. I agree that having contains would be better than starts with on e-mail, but the reason that this came up is that we're getting timeouts on our site with large numbers of orders when attempting to search via e-mail. |
2cb4ac5
to
e13e004
Compare
Changelog added in an amendment. |
I believe the contains is also useful for promotion codes. |
I think this is probably worth reaching out to a few places CS departments and do a quick ask to see if they ever use email addresses with "contains" like that. I know people could override the view and switch the query param back, but its potentially a disruptive thing. It would be nice if we could support wildcards ourselves and let people decide when to use them. |
@cbrunsdon @gmacdougall Can anything be done to move this forward? One of our promises with Solidus is to work well on large stores, which this change is necessary for. Maybe we should start by changing the less controversial searches, like |
I feel that all of the things listed here are large enough that non-indexed searches are inappropriate. It's not that hard to get millions of orders or promotion codes. |
@gmacdougall can we get this one rebased on master and review this work again? |
e13e004
to
227439b
Compare
======= | ||
click_on 'Filter' | ||
fill_in "q_promotions_codes_value_start", with: promotion.codes.first.value | ||
>>>>>>> e13e004... Switch order search to using starts over cont |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexpected token tRSHFT
unexpected token tIDENTIFIER
||||||| parent of e13e004... Switch order search to using starts over cont | ||
click_on 'Filter' | ||
fill_in "q_promotions_codes_value_cont", with: promotion.codes.first.value | ||
======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexpected token tEQQ
click_on "Filter Results" | ||
fill_in "q_order_promotions_promotion_code_value_cont", with: promotion.codes.first.value | ||
||||||| parent of e13e004... Switch order search to using starts over cont |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexpected token tOROP
unexpected token tIDENTIFIER
@@ -160,8 +160,16 @@ | |||
end | |||
|
|||
it "only shows the orders with the selected promotion" do | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexpected token tLSHFT
Change rebased and shall rise again! |
227439b
to
847bb0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this change, it just needs a rebase that fixes CHANGELOG (again) and the conflict error.
Going to request changes to point out that it needs some action, I'll approve once fixed! 👍
======= | ||
<%= label_tag :q_number_start, Spree.t(:order_number, :number => '') %> | ||
<%= f.text_field :number_start %> | ||
>>>>>>> e13e004... Switch order search to using starts over cont |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmacdougall I think this has been introduced rebasing and fixing the CHANGELOG conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. I'll fix that up.
51507cc
to
e6458c8
Compare
This is now rebased (properly)! |
e6458c8
to
2979d6f
Compare
Resolved conflict with the current |
@gmacdougall would you mind to rebase again so we can merge this? |
Due to the way that standard indexes work in modern databases. Use of contains to find a string is very inefficient. Instead, if we find things that start with the string, the index can find the records it is looking for very efficiently. This turns a table sequential scan into a simple index lookup signifncantly speeding things up, or avoiding timeouts on stores with millions of orders.
1d9679b
to
d565006
Compare
Rebased the CHANGELOG out of this. Should be good to go. |
Thank you! |
Due to the way that standard indexes work in modern databases. Use of
contains to find a string is very inefficient. Instead, if we find
things that start with the string, the index can find the records it is
looking for very efficiently.
This turns a table sequential scan into a simple index lookup
signifncantly speeding things up, or avoiding timeouts on stores with
millions of orders.
Example: