Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This query could be super slow. This table is huge.
It seems that we are filtering by user first, and some month ago we created an index on
full_name
but it would be good to check that this won't take the db down.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.
Great point. I'm not sure of the best way to test this though, other than looking at sql explain output or testing this in production. If you have any ideas to gauge this, it should be easy enough to run some queries directly.
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.
Yeah, I don't have a great idea about how to test this. However, a couple of queries on production could give us a good idea about how it will behave.
Also, I think we could enable "search as you type" under a feature flag (as a middle step for now) and if not enabled, it only filter by exact matches. Once we are sure that this is not taking down our DB, we can enable the feature to all the projects.
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.
Unfortunately, it's integral to the design and is not optional. A feature flag won't work in this case.
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 would be fine shipping this to test the performance, and we can roll back if query times look awful on user data. I feel like NR will give us the best data here.
It's also probably only going to be an issue at scale or with high throughput. It's not documented either, so stakes are pretty low for at least a test.
Seem reasonable?
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.
Sounds risky, 😄 --but we should be fine, or we rollback otherwise. It would be good to have a way to enable/disable this without re-deploying, tho.
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'll make a release note to test this more and watch NR, but i don't expect an issue. Manual queries in prod looked fine. It would be nice to have customer level feature flags, but honestly not much we'd use them for.
If APIv3 affords us any additional features for rate limiting, or token auth provides us with some additional security, we will eventually need this endpoint in APIv3 as well.