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

[CPDLP-1913] Restrict participants endpoint fields #2917

Merged
merged 1 commit into from Jan 22, 2023
Merged

Conversation

tvararu
Copy link
Contributor

@tvararu tvararu commented Jan 19, 2023

Context

This endpoint is currently timing out in production for certain providers. One possible way to speed it up is by reducing the amount of columns returned to only the necessary ones.

Changes proposed in this pull request

Restrict the fields being returned by the query underlying the /api/v1/participants/ecf endpoint.

Guidance to review

Before we merge this, it would be best to test it if possible to see if it has the expected effect of speeding up the endpoint when dealing with a prod-like data load.

This can be done locally, if we can get a prod-like database running with a similar amount of data, or it can be done on a prod-like env.

It's lacking a test, partly because I want to try it out first to see if it improves performance before I invest further, but also because testing for the removal of fields always feels weird to me. Checking if a field isn't found in a payload can easily be a false positive test. If someone has a better idea for a good way to test this, please shout and we can update this.

@tvararu
Copy link
Contributor Author

tvararu commented Jan 20, 2023

Tested this on a prod env using a benchmarking script, about a 2-3x improvement in this query which is great. This should be good to ship.

Copy link
Member

@peteryates peteryates left a comment

Choose a reason for hiding this comment

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

Looks great!

@tvararu
Copy link
Contributor Author

tvararu commented Jan 20, 2023

Can be merged once #2921 fixes the review app build 🤞

This endpoint is currently timing out in production for certain
providers. One possible way to speed it up is by reducing the amount of
columns returned to only the necessary ones.
@github-actions
Copy link

Created review app at https://ecf-review-pr-2917.london.cloudapps.digital

@github-actions
Copy link

Smoke tests passed against the review app.

@tvararu tvararu merged commit 32af71f into develop Jan 22, 2023
@tvararu tvararu deleted the CPDLP-1913 branch January 22, 2023 21:50
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.

None yet

2 participants