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

feat(rules): Revise query for optimization #1979

Merged
merged 4 commits into from
Aug 10, 2023
Merged

Conversation

yquansah
Copy link
Contributor

@yquansah yquansah commented Aug 10, 2023

Revise query to collect ruleIDs, and then use those collected IDs in subsequent query for the segments/constraints. We sort the rules at the end via the rank, so we can actually just remove the OrderBy clause in the first query to optimize.

Before this, the subquery here was not filtering rules based on flag_key or namespace_key.

@yquansah yquansah requested a review from a team as a code owner August 10, 2023 17:16
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #1979 (24159c6) into segment-anding (99564ea) will increase coverage by 0.09%.
Report is 71 commits behind head on segment-anding.
The diff coverage is 76.36%.

@@                Coverage Diff                 @@
##           segment-anding    #1979      +/-   ##
==================================================
+ Coverage           71.07%   71.16%   +0.09%     
==================================================
  Files                  67       68       +1     
  Lines                6541     6742     +201     
==================================================
+ Hits                 4649     4798     +149     
- Misses               1629     1672      +43     
- Partials              263      272       +9     
Files Changed Coverage Δ
internal/cmd/auth.go 0.00% <0.00%> (ø)
internal/storage/sql/migrator.go 20.00% <ø> (ø)
internal/ext/importer.go 71.11% <54.54%> (-2.99%) ⬇️
internal/ext/exporter.go 85.47% <68.00%> (-3.07%) ⬇️
internal/server/evaluation/evaluation.go 90.45% <70.96%> (-0.42%) ⬇️
internal/storage/fs/snapshot.go 68.08% <72.94%> (-0.13%) ⬇️
internal/s3fs/s3fs.go 68.21% <82.00%> (+2.88%) ⬆️
internal/ext/common.go 84.61% <84.61%> (ø)
internal/config/storage.go 81.42% <100.00%> (+1.74%) ⬆️
internal/server/evaluation/legacy_evaluator.go 98.50% <100.00%> (+0.07%) ⬆️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@yquansah yquansah merged commit 7db60c2 into segment-anding Aug 10, 2023
22 checks passed
@yquansah yquansah deleted the revise-query branch August 10, 2023 19:16
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.

1 participant