-
Notifications
You must be signed in to change notification settings - Fork 415
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
[#6570] improvement(core): Optimize fetching entity parent id logic #6574
base: main
Are you sure you want to change the base?
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.
Overall looks good to me.
Left a suggestion regarding the several parallel if
statements.
Long parentEntityId = null; | ||
if (namespace.levels().length >= 1) { | ||
if (namespace.levels().length == 1) { |
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 can get the optimization logic here.
Can we further revise this logic into a switch...case
for clarity?
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.
Okay
This is nice. |
What changes were proposed in this pull request?
Use
JOIN
to avoid fetching id several times when getting the parents of a fileset/table/topic/modelWhy are the changes needed?
It's very time-consuming to retrieve id from database several times.
Fix: #6570
Does this PR introduce any user-facing change?
N/A
How was this patch tested?
Existing UTs