-
Notifications
You must be signed in to change notification settings - Fork 86
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
[Indexer] Optimize indexer like query to ensure all querys can use indexes #2352
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
testnet indexer file size
SQLite explain query plan
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
popcnt1
approved these changes
Aug 3, 2024
jolestar
approved these changes
Aug 3, 2024
Comment on lines
+583
to
+597
fn test_optimize_like_query() { | ||
let gas_coin_object_type = "0x3::coin_store::CoinStore"; | ||
let (origin_bound, upper_bound) = optimize_like_query(gas_coin_object_type.to_string()); | ||
assert_eq!(origin_bound, gas_coin_object_type); | ||
assert_eq!(upper_bound, "0x3::coin_store::CoinStorf"); | ||
|
||
let object_type2 = | ||
"0x5350415253455f4d45524b4c455f504c414345484f4c4445525f484153480000::custom::CustomZZZ"; | ||
let (origin_bound, upper_bound) = optimize_like_query(object_type2.to_string()); | ||
assert_eq!(origin_bound, object_type2); | ||
assert_eq!( | ||
upper_bound, | ||
"0x5350415253455f4d45524b4c455f504c414345484f4c4445525f484153480000::custom::CustomZZ[" | ||
); | ||
} |
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.
原来 indexer 的 like 有个 bug,比如搜索 0xabcd::test::Account, 期望是得到 Account 以及 Account, 但同时会搜索出来 0xabcd::test::AccountABC。这个问题现在这个方案还有吧?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Optimize indexer to ensure all querys can use indexes.
like
query to Between And query, optimize table scan to index scan, and only take effect on the rightmost prefix.Notice:
This operation requires rebuilding the index when the server is restarted, and the server will be unavailable during the index rebuild.