-
Notifications
You must be signed in to change notification settings - Fork 331
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
Feature/db read entry - read entry/s using simple union sql, instead of the complex views/sqEntriesLineage #783
Conversation
Codecov Report
@@ Coverage Diff @@
## master #783 +/- ##
==========================================
+ Coverage 41.26% 42.65% +1.38%
==========================================
Files 131 135 +4
Lines 10146 10607 +461
==========================================
+ Hits 4187 4524 +337
- Misses 5403 5495 +92
- Partials 556 588 +32
Continue to review full report at Codecov.
|
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.
Update the PR title to have a meaningful description.
It will help me to add a short description of what you fixed or where in the code you address the issue.
Added Go related comments, but from the change part - it looks we have another version of 'sqEntriesLineage' just to fix the specific problem?
catalog/db_read_entry.go
Outdated
l := len(paths) | ||
if l == 1 { | ||
rawSelect = rawSelect.Where("path = ?", paths[0]) | ||
} else { | ||
rawSelect = rawSelect.Where(sq.Eq{"path": paths}) | ||
} |
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.
l := len(paths) | |
if l == 1 { | |
rawSelect = rawSelect.Where("path = ?", paths[0]) | |
} else { | |
rawSelect = rawSelect.Where(sq.Eq{"path": paths}) | |
} | |
rawSelect = rawSelect.Where(sq.Eq{"path": paths}) |
Let SQL optimize the IN with one element to =
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 have checked this - for some reason IN with one argument consumes more CPU. It may even be because of the driver handling of array
Co-authored-by: Barak Amar <barak.amar@treeverse.io>
Co-authored-by: Barak Amar <barak.amar@treeverse.io>
Co-authored-by: Barak Amar <barak.amar@treeverse.io>
Co-authored-by: Barak Amar <barak.amar@treeverse.io>
…ure/db_read_entry # Conflicts: # catalog/db_read_entry.go
not to do yet