-
Notifications
You must be signed in to change notification settings - Fork 799
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
[backend] Improvement to limit engine memory usage #5642
Conversation
@@ -1006,7 +1012,7 @@ export const RUNTIME_ATTRIBUTES = { | |||
// eslint-disable-next-line no-use-before-define | |||
const users = await elPaginate(context, user, READ_INDEX_INTERNAL_OBJECTS, { |
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.
could we load users from cache too here ?
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.
Updated
if (types && types.length > 0) { | ||
const typesShould = types.map((typeShould) => ( | ||
[ | ||
{ match_phrase: { 'entity_type.keyword': typeShould } }, | ||
{ match_phrase: { 'parent_types.keyword': typeShould } } | ||
{ term: { 'entity_type.keyword': typeShould } }, |
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.
here we could also do a terms query with the list of types instead of a list of should with one term.
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.
Updated
bd9d238
to
2e5aa8d
Compare
I tested locally and didn't find any bug related to this PR, but I'm not sure I tested all the cases. |
Use users cache for dynamic runtime sorting Change load by id term to terms to prevent too much clause
2e5aa8d
to
1261e1e
Compare
The idea is to limit the memory footprint of the engine query.
First round before oob/batch_list_through_refactor