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

Change Scan API to have no Order(ES) #4134

Merged
merged 4 commits into from
Apr 1, 2023

Conversation

samanbarghi
Copy link
Contributor

What changed?
Changed ElasticSearch Scan API to have no order (use "_doc").

Why?
Using sort order "_doc" when using Scan API has some optimizations in ES that
makes it faster to iterate over all workflows.

How did you test it?
Added unit tests

Potential risks
N/A

Is hotfix candidate?
No

@samanbarghi samanbarghi requested a review from a team as a code owner March 31, 2023 21:43
Copy link
Contributor

@rodrigozhou rodrigozhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add some validation in the Scan aPI to return an error if the query has an custom ORDER BY.
cc: @yiminc

@samanbarghi
Copy link
Contributor Author

You should add some validation in the Scan aPI to return an error if the query has an custom ORDER BY.

In that case, it might be better to refactor these functions a bit and also get rid of the control flag.

Copy link
Member

@yiminc yiminc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have Scan implementation for SQL store?

@samanbarghi
Copy link
Contributor Author

Do we have Scan implementation for SQL store?

Not yet, I will add that in a separate PR

@samanbarghi samanbarghi merged commit 6f1f022 into temporalio:master Apr 1, 2023

func (s *visibilityStore) getFieldSorter(fieldSorts []*elastic.FieldSort) []elastic.Sorter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used by getListFieldSorter, no need to be a separate function.

Comment on lines +94 to +97

searchParameterBuilder struct {
store *visibilityStore
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used anywhere. Remove it.

samanbarghi added a commit to samanbarghi/temporal that referenced this pull request May 2, 2023
* Change Scan API to have no Order(ES)

* Refactoring based on PR comments

* PR comments

* Fix return order
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

Successfully merging this pull request may close these issues.

3 participants