-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fix token_account primary index #1424
Conversation
Signed-off-by: Nana-EC <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1424 +/- ##
============================================
+ Coverage 85.07% 85.36% +0.28%
- Complexity 359 364 +5
============================================
Files 257 257
Lines 6367 6367
Branches 689 689
============================================
+ Hits 5417 5435 +18
+ Misses 722 707 -15
+ Partials 228 225 -3
Continue to review full report at Codecov.
|
Signed-off-by: Nana-EC <[email protected]>
@@ -79,7 +79,7 @@ alter table token | |||
set (timescaledb.compress, timescaledb.compress_segmentby = 'token_id'); | |||
|
|||
alter table token_account | |||
set (timescaledb.compress, timescaledb.compress_segmentby = 'account_id'); | |||
set (timescaledb.compress, timescaledb.compress_segmentby = 'account_id, token_id'); |
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.
Recommendation is to put the non-timestamp fields from your primary keys in the segmentby
. Think we should remove account_id
.
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.
Yes, with updated primary key makes sense for only token_id
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Kudos, SonarCloud Quality Gate passed!
|
Detailed description:
#1364 updated the token_account table to have a primary index on the timestamp.
However, an account can be associated with multiple tokens in a single TokenAssociate transaction.
V1.33.0__drop_token_account_id.sql
migration file to settoken_account
primary index to usecreated_timestamp, token_id
V2.0.2__time_scale_index_init.sql
file to settoken_account
primary index to usecreated_timestamp, token_id
TokenAccountRepositoryTest
with test to capture scenarioWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist